parent-dirs
Get an array of parent directories including itself
Last updated 2 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install parent-dirs 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

2 Versions

  • 1.0.0                                ...           2 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 49
Last Day 2
Last Week 20
Last Month 124
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2018 © taobao.org |