Database Reference
In-Depth Information
first(input,function(error,data) {
cb(data);
});
},
function(data,cb) {
second(data,function(error,moreData) {
cb(data,moreData);
});
},
function(data,moreData,cb) {
third(data,moreData,function(error,evenMoreData) {
//Do something here
cb(); //All done
});
}
]);
Managing a Node Project with NPM
To manage a node project's code, including managing dependencies such
as the
async
package used in the previous section, Node provides
npm
the “node package manager” in the node installation for most operating
systems. This utility provides services very similar to Maven in the Java
world or
gem
in the Ruby world.
Setting Up a Node Project
Starting a node project is as simple as creating a new directory and running
npm init
:
$ mkdir myproject
$ cd project
$ npm init
The NPM utility asks a series of questions about the project to get things
started. The end result of this process is the creation of a
package.json
file in the directory where
npm
was run:
This utility will walk you through creating a
package.json file.