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
;const rootPath = residence;// 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
;const rootPath = residence;// walks up the fs towards '/' and returns the path when it finds the first .nlu.json file// returns null otherwise.