Book Image

Node.js Blueprints

By : Krasimir Stefanov Tsonev
Book Image

Node.js Blueprints

By: Krasimir Stefanov Tsonev

Overview of this book

Table of Contents (19 chapters)
Node.js Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing the base of the application


Before starting the actual implementation of our file browser, we must prepare the HTML layout, the base of the JavaScript part, and the package.json file.

Writing the package.json file

The package.json file should be placed in the main path of the project. It's a file with content similar to the following code:

{
  "name": "FileBrowser",
  "main": "index.html",
  "window": {
    "toolbar": true,
    "width": 1024,
    "height": 800
  }
}

We already discussed the name and main properties. The window object is a desktop-specific setting; it tells node-webkit how the main application's window should look. In the preceding code, we set only three properties. The width and height properties defines the window size and toolbar hides or shows the uppermost panel, the one that makes our program look like a browser. Usually, we don't need it and at the end of the development cycle, we set toolbar to false. There are few other options we can apply, for example, title...