-
Notifications
You must be signed in to change notification settings - Fork 40
Getting Started
Create a folder for your application e.g.
$ mkdir myFirstNWAppThen change into the newly created folder.
$ cd myFirstNWAppDownload the package necessary for initializing your app.
$ npm install generator-node-webkitInitialize your app with the following command. For this you have to answer some questions about your app and select what platforms your app should be targeted on.
$ yo node-webkitNow you are ready to start developing your application.
The node-webkit-generator creates the following folders.
| Folder | What is it for? |
|---|---|
app |
This is the folder where your node-webkit application will be go in. After first initialization there will be an hello world application inside. You can structure it how you want. The requirement is that the package.json file is directly in the app folder. |
resources |
This folder stores files necessary to build different distributions from your application e.g. the node-webkit binaries. |
To test your app you have to build a distribution from it. Depending on your development system you have to use one of the following grunt tasks.
On a linux call
$ grunt dist-linux # for 64bit
$ grunt dist-linux32 # for 32bitOn a pc call
$ grunt dist-winOn a mac call
$ grunt dist-mac # for 64bit
$ grunt dist-mac32 # for 32bitThe resulting application can then be found in the folder dist.
You can run it now with the following commands depending again on your dev platform.
On a linux call
$ cd dist
$ ./node-webkit myfirstnwapp.appOn a mac call
$ dist/MacOS64/myfirstnwapp.app/Contents/MacOS/node-webkitCombine creation and starting the app in one line with grunt
On a linux call
$ grunt dist-linux && cd dist && ./linux64/node-webkit myfirstnwapp.appOn a mac call
$ grunt dist-mac && dist/MacOS64/myfirstnwapp.app/Contents/MacOS/node-webkit