But there are so many API’s • require, require.resolve • fs.readFile, fs.readFileSync, fs.ReadStream • fs.readlink, fs.stat, fs.statSync, fs.readlinkSync • …
SquashFS • a compressed read-only file system • used by the Live CD versions of Arch Linux, Debian, Fedora, Gentoo, Mint, Salix, Ubuntu • used on OpenWrt and DD-WRT router firmware
SquashFS • Introduced in 2009 with Linux 2.6.29 • File format very stabilized • Unsquashfs and mksquashfs have win32 ports; 7-Zip on win32 also supports SquashFS • Part of kernel; GPL Licensed
https://github.com/pmq20/libsquash libsquash • MIT licensed • Super embeddable • 1 dependency only, which could be statically linked • Compiles on 3 platforms, even Windows XP with VC++ 2010 • Introduces VFD - virtual file descriptor, intercepting system calls unobtrusively libsquash
nodec is also enclosed Operating System Architecture Download Link Windows x86 https://sourceforge.net/projects/ node-compiler/files/v0.9.4/ nodec.exe/download macOS x86-64 https://sourceforge.net/projects/ node-compiler/files/v0.9.4/nodec- darwin-x64/download Linux x86-64 https://sourceforge.net/projects/ node-compiler/files/v0.9.4/nodec- linux-x64/download
Install on Windows • SquashFS Tools 4.3 • Python 2.6 or 2.7 • Visual Studio 2015 Update 3, all editions including the Community edition (remember to select "Common Tools for Visual C++ 2015" feature during installation). • Then download the executable nodec.exe and run it from the VC++ or VS Command Prompt.
Enabling Node.js Developers • Build softwares instead of modules • Distribute to non-technical users • Merchandise by building personal / enterprise softwares
Code Protection • Enable code signing for the entire application; guarantee not being altered or corrupted • Prevent hacking by users modifying exposed Javascript source code • Applicable to NW.js applications (DingTalk) and Electron applications (Tea)