walk-back
Walk up the directory tree until the specified path is found.
Example
> walkBack = require('walk-back')
> walkBack(process.cwd(), 'package.json')
'/Users/lloyd/Documents/75lb/walk-back/package.json'
> walkBack(process.cwd(), '75lb')
'/Users/lloyd/Documents/75lb'
> walkBack(process.cwd(), '.bash_profile')
'/Users/lloyd/.bash_profile'
> walkBack(process.cwd(), 'non-existent.file')
null
walkBack(startAt, lookingFor) ⇒ string
⏏
Kind: Exported function
Returns: string
- absolute url to the found path
Param | Type | Description |
---|
startAt | string | the directory to start in |
lookingFor | string | the path we're looking for |
© 2015 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.