parent-dirs
Get an array of parent directories including itself
Last updated 3 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 (3 years ago)

2 Versions

  • 1.0.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 1
This Week 8
This Month 73
Last Day 6
Last Week 17
Last Month 77
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |