Ask HN: Would you recommend sharing code between an in-browser app and a CLI tool?
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).
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.
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?
2 comments
[ 4.6 ms ] story [ 15.7 ms ] thread