Returns Node.js global paths.
$ npm install node-global-paths
var paths = require( 'node-global-paths' );
Returns a list of Node global paths.
console.log( paths );
/*
e.g.,
[
'/Users/<user>/.node_modules',
'/Users/<user>/.node_libraries',
'/usr/local/<dir>/node/0.12.7/lib/node'
]
*/
var cwd = require( 'utils-cwd' )(),
paths = require( 'node-global-paths' );
var len = paths.length,
str,
i;
for ( i = 0; i < len; i++ ) {
str = cwd.substring( 0, paths[ i ].length );
if ( str === paths[ i ] ) {
console.log( 'Process running from a global Node path: %s.', paths[ i ] );
return;
}
}
console.log( 'Process is not running from a global Node path.' );
To run the example code from the top-level application directory,
$ node ./examples/index.js
Unit tests use the Mocha test framework with Chai assertions. To run the tests, execute the following command in the top-level application directory:
$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
$ make view-cov
Copyright © 2015. Athan Reines.