rOACCT/node_modules/common-dirf646e1f695a7paginated-inlines
README.md
     
<a name="module_common-dir"></a>
common-dir
<a name="exp_module_common-dir--commonDir"></a>
commonDir(files) ⇒ <code>string</code> ⏏
Returns the parent directory common to each path.
Kind: Exported function Returns: <code>string</code> - A single path ending with the path separator, e.g. '/user/some/folder/'
Param | Type | Description |
---|---|---|
files | <code>Array</code> | An array of file paths to inspect |
Example
js > 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.