Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)
npm install cwdEasily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (node.js/javascript util)
Install with npm:
``sh`
$ npm install cwd --save
`js`
var cwd = require('cwd');
cwd();
cwd('one/two.js');
cwd('one', 'two.js');
cwd(['one', 'two.js']);
You might also be interested in these projects:
* global-modules: The directory used by npm for globally installed npm modules. | homepage
* global-paths: Returns an array of unique "global" directories based on the user's platform and environment. The… more | homepage
* global-prefix: Get the npm global path prefix. | homepage
* is-absolute: Polyfill for node.js path.isAbolute. Returns true if a file path is absolute. | path.isAbolutetrue. Returns true if a file path is absolute."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* is-relative: Returns if the path appears to be relative. | true if the path appears to be relative."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* relative: Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file… more | homepage
This document was generated by verb, please don't edit directly. Any changes to the readme must be made in .verb.md. See Building Docs.
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
`sh`
$ npm install -g verb verb-readme-generator && verb
Install dev dependencies:
`sh``
$ npm install -d && npm test
Jon Schlinkert
* github/jonschlinkert
* twitter/jonschlinkert
Copyright © 2016, Jon Schlinkert.
Released under the MIT license.
*
_This file was generated by verb, v0.9.0, on June 05, 2016._