This is an example node-webkit app. It is very bare bones and could be used as a simple boilerplate to get up and running quickly. A Gulp workflow is provided for CSS/JavaScript development.
####Requirements To run this example you will need node-webkit in the root of this project folder. The easiest was to do this is to download the version that corresponds to your operating system here:
https://github.com/rogerwang/node-webkit#downloads
Once you have node-webkit you can run the example by running the following from your terminal at the project root folder:
nw.exe app
####Development To start making changes to the example app you need to install all Gulp dependencies. From the Gulp directory in your terminal, run the following: ```` npm install ```` Note that this Gulp workflow is using gulp-ruby-sass, so you will also need the Sass Gem installed if you dont already have it. You can alternatively use your favorite Sass compiler, but I find Ruby Sass to suite all my needs.
The following Gulp tasks have been defined and can be run from the gulp location in your terminal:
| gulp | default task that compiles your css and javascript, watches for any css/javascript changes, and runs the example app |
| gulp build | compile and minifiy css and javascript files |
| gulp app | open the example app by running "nw.exe app" from gulp-shell |
####Folder Structure
Root
│
├── ... extracted node-webkit files (nw.exe, etc.)
├── [gulp]
│ │
│ ├── gulpfile.js
│ ├── package.json
│ └── [src]
│ │
│ ├── [js]
│ │ │
│ │ ├── script.js (main script file for app)
│ │ └── ... (modules like jquery that are included in scripts.js)
│ │
│ └── [scss]
│
└── [app]
│
└── ... app files and folders (index.html, style.css, etc.)
####Resources Shane Gavin over at nodehead.com has put together a great mini-series on getting started with node-webkit. Here are links to the six videos
- http://nodehead.com/node-webkit-introduction-16/
- http://nodehead.com/node-webkit-custom-window-controls-26/
- http://nodehead.com/node-webkit-the-manifest-file/
- http://nodehead.com/node-webkit-context-and-window-menus/
- http://nodehead.com/node-webkit-using-node-js-modules/
- http://nodehead.com/node-webkit-wrapping-it-up/
Set of sample apps from Cheng Zhao: https://github.com/zcbenz/nw-sample-apps