cwd

Node.js util for easily getting the current working directory of a project based on package.json or the given path.

cwd

Node.js util for easily getting the current working directory of a project based on package.json or the given path.

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
  • is-absolute: Return true if a file path is absolute.
  • is-relative: Returns true if the path appears to be relative.
  • export-files: node.js utility for exporting a directory of files as modules.
  • normalize-path: Normalize file path slashes to be unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes.
  • relative: Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file, and directory-to-directory.

Jon Schlinkert

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 05, 2015.