ancestor-directories
v1.0.3
Published
Iterate over all parent directories of a given path
Downloads
104
Maintainers
Readme
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)