# Node-WebKit CheatSheet # Download: https://github.com/rogerwang/node-webkit#downloads # Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions # Wiki: https://github.com/rogerwang/node-webkit/wiki # How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium # 1. Run your application. # https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps # Compress your application including index.html and package.json into a zip archive and rename it to app.nw ./nw path_to_app.nw # Or run the directory including your application ./nw path_to_app_dir # Only on Mac OSX, you can also use nw like this. (assuming it's installed to the Applications directory) open -n -a node-webkit "/home/path/to/app" # 2. Package your application. # https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps # Windows: Making an executable file out of a .nw file. copy /b nw.exe+app.nw app.exe # Linux: Making an executable file out of a .nw file. cat /usr/bin/nw app.nw > app && chmod +x app # Max OSX: Making an executable file out of a .nw file. # https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps#mac-os-x # 3. Command Lines Switches. # https://github.com/rogerwang/node-webkit/wiki/Command-line-switches#--urlwebsite-url ./nw path_to_app_dir --url="website-url" # Directly open "website-url". ./nw path_to_app_dir --no-toolbar # Force disabling toolbar. ./nw path_to_app_dir --data-path # Override the default data path (where cookies and localStorage etc. resides). # 4. Compile to Native Code and Protect JavaScript Source Code. # https://github.com/rogerwang/node-webkit/wiki/Protect-JavaScript-source-code-with-v8-snapshot nwsnapshot --extra_code source.js snapshot.bin # JS source code is compiled to native code (aka. 'snapshot'). # Then, add the following field to package.json: "snapshot" : "snapshot.bin" # 5. Application Auto Building Scripts for Linux Windows and OSX. # https://github.com/rogerwang/node-webkit/wiki/Application-auto-building-scripts-for-Linux-Windows-and-OSX