
Ask HN: Would you recommend sharing code between an in-browser app and a CLI tool? - bakery2k
I am working with some image files in a proprietary format. I would like to write a viewer for these files that runs in the browser (using HTML canvas), and a command-line tool to convert the files into a standard format such as PNG (for use in scripts, makefiles etc).<p>Do you think I should try to share code between these two projects? The obvious benefit of doing so is that I would only need one version of the image format decoder. However, sharing code would limit my choice of languages for the command-line tool - it would need to be written either in JavaScript itself or in some other language that can be compiled to JavaScript.<p>Are you, or have you considered, sharing code between the browser and a native app in this way? What language (and tools) are you using? Would you recommend your solution?
======
PaulHoule
If you like writing Node.JS go ahead.

~~~
bakery2k
Are there tools for Node.js that can create standalone command-line apps? Can
you recommend any in particular?

