Bachir Soussi Chiadmi cefd1c2ad0 updated sys and created publi | 7 lat temu | |
---|---|---|
.. | ||
index.js | 7 lat temu | |
license | 7 lat temu | |
package.json | 7 lat temu | |
readme.md | 7 lat temu |
Find a file by walking up parent directories
$ npm install --save find-up
/
└── Users
└── sindresorhus
├── unicorn.png
└── foo
└── bar
├── baz
└── example.js
// example.js
const findUp = require('find-up');
findUp('unicorn.png').then(filepath => {
console.log(filepath);
//=> '/Users/sindresorhus/unicorn.png'
});
Returns a promise for the filepath or null
.
Returns a filepath or null
.
Type: string
Filename of the file to find.
Type: string
Default: process.cwd()
Directory to start from.
MIT © Sindre Sorhus