residence
Find project root given current working directory
Last updated 10 months ago by oresoftware .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install residence 
SYNC missed versions from official npm registry.

Version

Residence

Allows you find a root of a project given current working directory (process.cwd())

Examples

Looking for the NPM project root, by looking for package.json

import * as residence from 'residence';
const rootPath = residence.findProjectRoot(process.cwd());
// root is either null or a project root path, found by looking for the first package.json file

Looking for a project root, by looking for another file

import * as residence from 'residence';
const rootPath = residence.findRootDir(process.cwd(), '.nlu.json');
// walks up the fs towards '/' and returns the path when it finds the first .nlu.json file
// returns null otherwise.

Current Tags

  • 0.0.217                                ...           latest (10 months ago)

18 Versions

  • 0.0.217                                ...           10 months ago
  • 0.0.216                                ...           a year ago
  • 0.0.215                                ...           2 years ago
  • 0.0.214                                ...           2 years ago
  • 0.0.213                                ...           2 years ago
  • 0.0.212                                ...           2 years ago
  • 0.0.211                                ...           2 years ago
  • 0.0.210                                ...           2 years ago
  • 0.0.209                                ...           2 years ago
  • 0.0.208                                ...           2 years ago
  • 0.0.207                                ...           3 years ago
  • 0.0.206                                ...           3 years ago
  • 0.0.205                                ...           3 years ago
  • 0.0.204                                ...           3 years ago
  • 0.0.203                                ...           3 years ago
  • 0.0.202                                ...           3 years ago
  • 0.0.201                                ...           3 years ago
  • 0.0.1                                ...           4 years ago

Copyright 2014 - 2016 © taobao.org |