parent-dirs

Get an array of parent directories including itself


Keywords
parent, directories, parents, folders, path, paths, array, list
License
MIT
Install
npm install parent-dirs@1.0.0

Documentation

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