1 # find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up)
3 > Find a file by walking up parent directories
9 $ npm install --save find-up
28 const findUp = require('find-up');
30 findUp('unicorn.png').then(filepath => {
31 console.log(filepath);
32 //=> '/Users/sindresorhus/unicorn.png'
39 ### findUp(filename, [options])
41 Returns a promise for the filepath or `null`.
43 ### findUp.sync(filename, [options])
45 Returns a filepath or `null`.
51 Filename of the file to find.
58 Default: `process.cwd()`
60 Directory to start from.
65 - [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
66 - [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
67 - [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
72 MIT © [Sindre Sorhus](http://sindresorhus.com)