Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

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
17,709,636
decreased by-12.47%

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,183,248 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

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
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