Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

commondir

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Issues
File Explorer

Advanced tools

commondir

compute the closest common parent for file paths

    1.0.1latest

Version published
Maintainers
1
Weekly downloads
18,008,027
decreased by-3.63%

Weekly downloads

Readme

Source

commondir

compute the closest common parent directory among an array of directories

example

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

methods

var commondir = require('commondir');

commondir(absolutePaths)

Compute the closest common parent directory for an array absolutePaths.

commondir(basedir, relativePaths)

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).

install

With npm do:

npm install commondir

license

MIT

Keywords

FAQs

What is commondir?

compute the closest common parent for file paths

Is commondir popular?

The npm package commondir receives a total of 14,506,818 weekly downloads. As such, commondir popularity was classified as popular.

Is commondir well maintained?

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.

Last updated on 14 Mar 2015
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc