# findup-sync

> Find the first file matching a given pattern in the current directory or the nearest ancestor directory.

Latest version **5.0.0** (published 2021-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install findup-sync
pnpm add findup-sync
yarn add findup-sync
bun add findup-sync
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2021-10-31 |
| First published | 2012-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/findup-sync) |
| Module format | CommonJS |
| Node | >= 10.13.0 |
| Dependencies | 4 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 98 |
| Author | Gulp Team |
| Maintainers | sttk, phated, cowboy, tkellen, jonschlinkert |
| Keywords | file, find, find-up, findup, glob, match, pattern, resolve, search |

## Links

- npm: https://www.npmjs.com/package/findup-sync
- Repository: https://github.com/gulpjs/findup-sync
- Homepage: https://github.com/gulpjs/findup-sync#readme
- Issues: https://github.com/gulpjs/findup-sync/issues
- npm.io page: https://npm.io/package/findup-sync

## Dependencies (4)

- [is-glob](https://npm.io/package/is-glob.md) ^4.0.3
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.4
- [detect-file](https://npm.io/package/detect-file.md) ^1.0.0
- [resolve-dir](https://npm.io/package/resolve-dir.md) ^1.0.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 5.0.0 (latest) — 2021-10-31
- 4.0.0 — 2019-07-14
- 3.0.0 — 2018-12-28
- 2.0.0 — 2017-08-07
- 1.0.0 — 2017-04-18
- 0.4.3 — 2016-10-12
- 0.4.2 — 2016-07-10
- 0.4.1 — 2016-05-19
- 0.4.0 — 2016-04-02
- 0.3.0 — 2015-09-15
- 0.2.1 — 2014-12-17
- 0.2.0 — 2014-12-16
- 0.1.3 — 2014-03-14
- 0.1.2 — 2013-03-08
- 0.1.1 — 2012-11-15
- … 1 more at https://npm.io/package/findup-sync/versions

## README

<p align="center">
  <a href="http://gulpjs.com">
    <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  </a>
</p>

# findup-sync

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Find the first file matching a given pattern in the current directory or the nearest ancestor directory.

Matching is done with [micromatch][micromatch], please report any matching related issues on that repository.

## Usage

```js
var findup = require('findup-sync');
findup(patternOrPatterns [, micromatchOptions]);

// Start looking in the CWD.
var filepath1 = findup('{a,b}*.txt');

// Start looking somewhere else, and ignore case (probably a good idea).
var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});
```

## API

### `findup(patterns, [options])`

- `patterns` **{String|Array}**: Glob pattern(s) or file path(s) to match against.
- `options` **{Object}**: Options to pass to [micromatch]. Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here.
- `returns` **{String}**: Returns the first matching file.

## License

MIT

<!-- prettier-ignore-start -->

[downloads-image]: https://img.shields.io/npm/dm/findup-sync.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/findup-sync
[npm-image]: https://img.shields.io/npm/v/findup-sync.svg?style=flat-square
[ci-url]: https://github.com/gulpjs/findup-sync/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/findup-sync/dev?style=flat-square
[coveralls-url]: https://coveralls.io/r/gulpjs/findup-sync
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/findup-sync/master.svg

<!-- prettier-ignore-nd -->

<!-- prettier-ignore-start -->

[micromatch]: http://github.com/micromatch/micromatch

<!-- prettier-ignore-nd -->

---
_Source: https://npm.io/package/findup-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
