How to Compile Node.js Code Using Bytenode?
▻https://hackernoon.com/how-to-compile-node-js-code-using-bytenode-11dcba856fa9?source=rss----3a
In this post, I will show you how to “truly” compile Node.js (JavaScript) code to V8 Bytecode. This allows you to hide or protect your source code in a better way than obfuscation or other not-very-efficient tricks (like encrypting your code using a secret key, which will be embedded in your app binaries, that’s why I said “truly” above).So, using bytenode tool, you can distribute a binary version .jsc of your #javascript files. You can also bundle all your .js files using Browserify, then compile that single file into .jsc.Check bytenode repository on Github.Long story short..Install bytenode globally:[sudo] npm install -g bytenodeTo compile your .js file, run this command:bytenode —compile my-file.js my-file.jscInstall bytenode in your project too:npm install —save bytenodeIn your code, require (...)
#electron #electronjs #nwjs #nodejs