JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 106625
  • Score
    100M100P100Q146143F
  • License MIT

Returns the parent directory common to each path

Package Exports

  • common-dir

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (common-dir) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

view on npm npm module downloads Gihub repo dependents Gihub package dependents Build Status js-standard-style

common-dir

commonDir(files) ⇒ string

Returns the parent directory common to each path.

Kind: Exported function
Returns: string - A single path ending with the path separator, e.g. '/user/some/folder/'

Param Type Description
files Array An array of file paths to inspect

Example

> const commonDir = require('common-dir')
> files = [
  '/Users/75lb/one/package.json',
  '/Users/75lb/one/test',
  '/Users/75lb/two/test/main.js'
]
> commonDir(files)
'/Users/75lb/'

© 2014-21 Lloyd Brookes 75pound@gmail.com. Documented by jsdoc-to-markdown.