lyxaira.glass 74ca844f42 Actualizacion cambios generados: seccion #12, #14 y #15. | hace 4 años | |
---|---|---|
.. | ||
index.js | hace 4 años | |
license | hace 4 años | |
package.json | hace 4 años | |
readme.md | hace 4 años |
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'
});
findUp(['rainbow.png', 'unicorn.png']).then(filepath => {
console.log(filepath);
//=> '/Users/sindresorhus/unicorn.png'
});
Returns a Promise
for the filepath or null
.
Returns a Promise
for the first filepath found (by respecting the order) or null
.
Returns a filepath or null
.
Returns the first filepath found (by respecting the order) or null
.
Type: string
Filename of the file to find.
Type: string
Default: process.cwd()
Directory to start from.
MIT © Sindre Sorhus