Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying NW.js Essentials
  • Table Of Contents Toc
  • Feedback & Rating feedback
NW.js Essentials

NW.js Essentials

By : Benoit
4.8 (5)
close
close
NW.js Essentials

NW.js Essentials

4.8 (5)
By: Benoit

Overview of this book

If you are an experienced Node.js developer who wants to create amazing desktop applications using NW.js, this is the book for you. Prior knowledge of HTML5, jQuery, and CSS is assumed.
Table of Contents (11 chapters)
close
close
10
Index

Development tools

As you'll make use of third-party modules of Node.js, you're going to need npm in order to download and install all the dependencies; so, Node.js (http://nodejs.org/) or io.js (https://iojs.org/) must be obviously installed in your development environment.

I know you cannot wait to write your first application, but before you start, I would like to introduce you to Sublime Text 2. It is a simple but sophisticated IDE, which, thanks to the support for custom build scripts, allows you to run (and debug) NW.js applications from inside the editor itself.

If I wasn't convincing and you'd rather keep using your favorite IDE, you can skip to the next section; otherwise, follow these steps to install and configure Sublime Text 2:

  1. Download and install Sublime Text 2 for your platform from http://www.sublimetext.com/.
  2. Open it and from the top menu, navigate to Tools | Build System | New Build System.
  3. A new edit screen will open; paste the following code depending on your platform:
    • On Mac OS X:
      {
        "cmd": ["nwjs", "--enable-logging", "${project_path:${file_path}}"],
        "working_dir": "${project_path:${file_path}}",
        "path": "/Applications/nwjs.app/Contents/MacOS/"
      }
    • On Microsoft Windows:
      {
        "cmd": ["nw.exe", "--enable-logging", "${project_path:${file_path}}"],
        "working_dir": "${project_path:${file_path}}",
        "path": "C:/Tools/nwjs/",
        "shell": true
      }
    • On Linux:
      {
        "cmd": ["nw", "--enable-logging", "${project_path:${file_path}}"],
        "working_dir": "${project_path:${file_path}}",
        "path": "/home/userName/nwjs/"
      }
  4. Type Ctrl + S (Cmd + S on Mac) and save the file as nw-js.sublime-build.

Perfect! Now you are ready to run your applications directly from the IDE.

Tip

There are a lot of packages, such as SublimeLinter, LiveReload, and Node.js code completion, available to Sublime Text 2. In order to install them, you have to install Package Control first. Just open https://sublime.wbond.net/installation and follow the instructions.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
NW.js Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon