With the installation of Node, the Node Package Manager (NPM) is also installed. NPM is actually the utility that we will use for our normal development cycle.
NPM allows you to install libraries, manage the dependencies of your projects, and define a set of commands to build your code.
To start, just create a new folder for your project and initialize it from there:
$ me@~> mkdir validator $ me@~> cd validator $ me@~/validator> npm init
The last command, npm init
, will invoke NPM to generate package.json
inside the current directory; during the process, it will ask you some questions. Most of them are self-explanatory, but if you do not know what to answer just press ENTER. Do not worry; you will be able to edit the package.json
file later. This is my package.json
file:
{ "name": "validator", "version": "0.1.0", "description": "A validation service for Weird LTD.", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified...