Need private packages and team management tools?Check out npm Teams »

ancestor-directories

1.0.3 • Public • Published

ancestor-directories

Iterate over all parent directories of a given path

Requirements

  • Node.js ≥ 8.9.0

APIs

Function Signature

declare function allAncestorDirectories (path: string): IterableIterator<string>

Example

import process from 'process'
import {allAncestorDirectories} from 'ancestor-directories'
 
const ancestors = [...allAncestorDirectories(process.cwd())]
console.log('All ancestors of cwd', ancestors)

License

MIT © Hoàng Văn Khải

Install

npm i ancestor-directories

DownloadsWeekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

1.93 kB

Total Files

4

Last publish

Collaborators

  • avatar