Desktop <--> Mobile Code Sharing [Javascript]
<p>I couldn't find a satisfying answer so here is the question;</p>

<p>I am developing an HTML5-Websocket based application and I will be porting it to Mobile too.</p>

<p>The problem is that 2/3 of my features won't be in the mobile version and features are tightly integrated into HTML with JS.</p>

<p>If I can elegantly separate those 1/3 features, I will be DRY. However I couldn't find an easy solution for this. </p>

<p>For example, I have a function which gets the user object from node and process it in a function. For mobile, I will need the same flow but except 2/3 of the flow. I can create different functions for them and put them into the different files but this will bring a maintenance nightmare, since I will need to create tens of extra functions for even simple features.</p>

<p>Is there any good framework or way of doing these things out there for this job? </p>
