DEV Community

Discussion on: Why we migrated our CLI from NodeJS to GoLang 💻

Collapse
 
gijovarghese profile image
Gijo Varghese • Edited

You could use ncc from Zeit to compile NodeJS to a single file

Collapse
 
picocreator profile image
Eugene Cheah

Hmm, ur right should have gave it a try did honestly miss this one 😅

Collapse
 
nickytonline profile image
Nick Taylor • Edited

There's even Zeit's pkg which I believe builds on the work of ncc. It generates a binary so you don't even need node installed.

GitHub logo zeit / pkg

Package your Node.js project into an executable

Disclaimer: pkg was created for use within containers and is not intended for use in serverless environments. For those using ZEIT Now, this means that there is no requirement to use pkg in your projects as the benefits it provides are not applicable to the platform.


Build Status Coverage Status Dependency Status devDependency Status Join the community on Spectrum

This command line interface enables you to package your Node.js project into an executable that can be run even on devices without Node.js installed.

Use Cases

  • Make a commercial version of your application without sources
  • Make a demo/evaluation/trial version of your app without sources
  • Instantly make executables for other platforms (cross-compilation)
  • Make some kind of self-extracting archive or installer
  • No need to install Node.js and npm to run the packaged application
  • No need to download hundreds of files via npm install to deploy your application. Deploy it as a single file
  • Put your assets inside the executable to make it even more portable
  • Test…