Installing Node.jsMac OS X1. Go to http://nodejs.org and click install2. Install the downloaded packageWindows1. Go to http://nodejs.org and click install2. Install the downloaded packageLinux (and *nix variants)1. Go to http://nodejs.org and click install2. Decompress source and… ./configure … make … make install ( for Ubuntu use Chris Lea’s PPA – ppa:chris-lea/node.js )
Async provides several useful patterns for asynchronous control flow including: parallel, series, waterfall, auto and queue. Visit https://github.com/caolan/asyncfor a detailed guide on using the async module.
The Node Package Manager otherwise know as… NPM It’s how you harness the awesomeness of the Node.js community!
Using NPMIt’s standard practice to install modules locally for your current project.Modules are installed in the ./node_modules in the current directory.To Install a new modulenpm install <module>To find a module in the NPM repositorynpm search <search string>To list the modules (and their dependencies) in the current projectnpm listTo see module detailsnpm info <module>
DON’T INSTALLMODULES GLOBALLY! Unless they are tools like node-dev, jake, express, minify-js OR linked development modules but more on that later.
NPM is awesome sauce! Visit https://npmjs.orgfor more details about NPM and tobrowse the current NPM Repository
Basic Module ExampleEverything exposed via module.exports is available as an instance variable.Once you’ve created a module you use it like this…Keep this in mind… modules are loaded once and cached. So whenyou load the module a second time in your app, require justreturns the cache copied. This lets you do interesting things…
Installing your module• Run npm link in the module working directory• Then run npm link <module> in the your project folder to link it from the global module to your local node_modules.• OR you can create a private registry (See https://npmjs.org/doc/registry.html)• OR just link it by hand :P
My Favorite Modules• request • jake• async • hogan.js• node-dev • connect• underscore • moment• express • mysql