cwd

Easily get the CWD (current working directory) of a project based on package.json, optionally starting from a given path. (Node.js/javascript util)

cwd

Easily 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

$ npm i cwd --save
var cwd = require('cwd');
cwd();
cwd('one/two.js');
cwd('one', 'two.js');
cwd(['one', 'two.js']);

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Install dev dependencies:

$ npm i -d && npm test
  • global-paths: Returns an array of unique "global" directories based on the user's platform and environment. The… more
  • global-prefix: Get the npm global path prefix.
  • global-modules: The directory used by npm for globally installed npm modules.
  • is-absolute: Return true if a file path is absolute.
  • is-relative: Returns true if the path appears to be relative.
  • relative: Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file,… more

Jon Schlinkert

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 20, 2015.