npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

parent-dirs

1.0.0 • Public • Published

parent-dirs Build Status

Get an array of parent directories including itself

Install

$ npm install --save parent-dirs

Usage

const parentDirs = require('parent-dirs');
 
parentDirs(__dirname);
/*
[
    '/Users/sindresorhus/dev/parent-dirs',
    '/Users/sindresorhus/dev',
    '/Users/sindresorhus',
    '/Users',
    '/'
]
*/

API

parentDirs(cwd)

cwd

Type: string
Default: process.cwd()

Directory starting point to return paths from.

License

MIT © Sindre Sorhus

install

npm i parent-dirs

Downloadsweekly downloads

896

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability