Friday, March 1, 2013

How to Install Node Modules

npm-install node-markdown

Search for Node.js Modules

npm search | grep markdown
npm search markdown
Or you can head to search.npmjs.org :)

Restarting a script automatically when modified

Node-dev is a development tool for Node.js that automatically restarts the node process when a script is modified.

With node-dev you don't have to manually specify which files should be watched nor do you have to deal with ignore lists for files that should be excluded. This is done using a thin wrapper script that hooks into the require() function as well as into several methods of the VM module to determine which files need to be monitored.

This does not only work for .js files, but also for .json or .node or .coffee files or any other custom extension that has been added to require.extensions.

Another great benefit of this zero-config approach is that it doesn't cause any unnecessary restarts when for example client-side only scripts are modified.
https://github.com/fgnass/node-dev

Be sure that npm is installed.
Be sure that npm-dev is installed.

sudo npm install node-dev -g
node-dev script.js
Script will automatically run on filesave

Total Size of a Directory in Linux

du -ch | grep total
du -sch directory/