Comparing version
@@ -10,4 +10,14 @@ 'use strict' | ||
* @example | ||
* > walkBack = require('walk-back') | ||
* const walkBack = require('walk-back') | ||
*/ | ||
module.exports = walkBack | ||
/** | ||
* Returns an absolute file path (if found) else `null`. | ||
* | ||
* @param {string} - the directory to start in | ||
* @param {string} - the path we're looking for | ||
* @return {string} | ||
* @alias module:walk-back | ||
* @example | ||
* > walkBack(process.cwd(), 'package.json') | ||
@@ -28,12 +38,2 @@ * '/Users/lloyd/Documents/75lb/walk-back/package.json' | ||
*/ | ||
module.exports = walkBack | ||
/** | ||
* Returns an absolute file path (if found) else `null`. | ||
* | ||
* @param {string} - the directory to start in | ||
* @param {string} - the path we're looking for | ||
* @return {string} | ||
* @alias module:walk-back | ||
*/ | ||
function walkBack (startAt, lookingFor) { | ||
@@ -40,0 +40,0 @@ var dirs = path.resolve(startAt).split(path.sep) |
{ | ||
"name": "walk-back", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Walk up the directory tree until the specified path is found.", | ||
@@ -16,3 +16,4 @@ "repository": "https://github.com/75lb/walk-back.git", | ||
"find", | ||
"file" | ||
"file", | ||
"system" | ||
], | ||
@@ -28,4 +29,4 @@ "engines": { | ||
"jsdoc-to-markdown": "^1.3.3", | ||
"tape": "^4.2.0" | ||
"tape": "^4.4.0" | ||
} | ||
} |
[](https://www.npmjs.org/package/walk-back) | ||
[](https://www.npmjs.org/package/walk-back) | ||
[](https://www.npmjs.org/package/walk-back) | ||
[](https://travis-ci.org/75lb/walk-back) | ||
@@ -13,4 +13,17 @@ [](https://david-dm.org/75lb/walk-back) | ||
```js | ||
> walkBack = require('walk-back') | ||
const walkBack = require('walk-back') | ||
``` | ||
<a name="exp_module_walk-back--walkBack"></a> | ||
### walkBack(startAt, lookingFor) ⇒ <code>string</code> ⏏ | ||
Returns an absolute file path (if found) else `null`. | ||
**Kind**: Exported function | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| startAt | <code>string</code> | the directory to start in | | ||
| lookingFor | <code>string</code> | the path we're looking for | | ||
**Example** | ||
```js | ||
> walkBack(process.cwd(), 'package.json') | ||
@@ -31,16 +44,5 @@ '/Users/lloyd/Documents/75lb/walk-back/package.json' | ||
``` | ||
<a name="exp_module_walk-back--walkBack"></a> | ||
### walkBack(startAt, lookingFor) ⇒ <code>string</code> ⏏ | ||
Returns an absolute file path (if found) else `null`. | ||
**Kind**: Exported function | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| startAt | <code>string</code> | the directory to start in | | ||
| lookingFor | <code>string</code> | the path we're looking for | | ||
* * * | ||
© 2015 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). | ||
© 2015-16 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6374
0.68%47
4.44%