commondir
Advanced tools
compute the closest common parent for file paths
Weekly downloads
Readme
compute the closest common parent directory among an array of directories
var commondir = require('commondir');
var dir = commondir(process.argv.slice(2))
console.log(dir);
output:
$ node dir.js /x/y/z /x/y /x/y/w/q
/x/y
$ node ../baz ../../foo/quux ./bizzy
/foo
var commondir = require('commondir');
Compute the closest common parent directory for an array absolutePaths
.
Compute the closest common parent directory for an array relativePaths
which
will be resolved for each dir
in relativePaths
according to:
path.resolve(basedir, dir)
.
With npm do:
npm install commondir
MIT
compute the closest common parent for file paths
The npm package commondir receives a total of 14,506,818 weekly downloads. As such, commondir popularity was classified as popular.
We found that commondir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.