sindresorhus/find-up-simple

Find a file or directory by walking up parent directories — Zero dependencies

JavaScript

83

8 commits

updated Sep 18, 2026

See the code

README

find-up-simple

Find a file or directory by walking up parent directories

This is a simpler version of my find-up package, now with zero dependencies.

Install

npm install find-up-simple

Usage

/
└── Users
    └── sindresorhus
        ├── unicorn.png
        └── foo
            └── bar
                ├── baz
                └── example.js

example.js

import {findUp} from 'find-up-simple';

console.log(await findUp('unicorn.png'));
//=> '/Users/sindresorhus/unicorn.png'

API

findUp(name, options?)

Returns a Promise for the found path or undefined if it could not be found.

findUpSync(name, options?)

Returns the found path or undefined if it could not be found.

name

Type: string

The name of the file or directory to find.

options

Type: object

cwd

Type: URL | string
Default: process.cwd()

The directory to start from.

type

Type: string
Default: 'file'
Values: 'file' | 'directory'

The type of path to match.

stopAt

Type: URL | string
Default: Root directory

The last directory to search before stopping.

FAQ

How is it different from find-up?

  • No support for multiple input names
  • No support for finding multiple paths
  • No custom matching
  • No symlink option
  • Zero dependencies

sindresorhus/find-up-simple

Find a file or directory by walking up parent directories — Zero dependencies

JavaScript

83

8 commits

updated Sep 18, 2026

See the code

README

find-up-simple

Find a file or directory by walking up parent directories

This is a simpler version of my find-up package, now with zero dependencies.

Install

npm install find-up-simple

Usage

/
└── Users
    └── sindresorhus
        ├── unicorn.png
        └── foo
            └── bar
                ├── baz
                └── example.js

example.js

import {findUp} from 'find-up-simple';

console.log(await findUp('unicorn.png'));
//=> '/Users/sindresorhus/unicorn.png'

API

findUp(name, options?)

Returns a Promise for the found path or undefined if it could not be found.

findUpSync(name, options?)

Returns the found path or undefined if it could not be found.

name

Type: string

The name of the file or directory to find.

options

Type: object

cwd

Type: URL | string
Default: process.cwd()

The directory to start from.

type

Type: string
Default: 'file'
Values: 'file' | 'directory'

The type of path to match.

stopAt

Type: URL | string
Default: Root directory

The last directory to search before stopping.

FAQ

How is it different from find-up?

  • No support for multiple input names
  • No support for finding multiple paths
  • No custom matching
  • No symlink option
  • Zero dependencies

Project health

Overall

3.6/10

Maintained

0/10

Code review

2/10
OpenSSF Scorecard

Latest release

1.0.1 · Mar 1, 2025

Releases this year

0

Significant stargazers

fregante

1,983 followers · starred Nov 2023

silverwind

670 followers · starred Nov 2023

Erick Zhao

533 followers · starred Feb 2025

Garfield Lee

475 followers · starred Dec 2024