Skip to content

Allows you find an NPM root of a project given current working directory

License

Notifications You must be signed in to change notification settings

ORESoftware/residence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


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.

About

Allows you find an NPM root of a project given current working directory

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published