findup-sync (5.0.0)

Published 2026-02-24 13:56:52 +00:00 by atheaadmin

Installation

registry=
npm install findup-sync@5.0.0
"findup-sync": "5.0.0"

About this package

findup-sync

NPM version Downloads Build Status Coveralls Status

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

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

Usage

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

Dependencies

Dependencies

ID Version
detect-file ^1.0.0
is-glob ^4.0.3
micromatch ^4.0.4
resolve-dir ^1.0.1

Development Dependencies

ID Version
eslint ^7.21.0
eslint-config-gulp ^5.0.1
eslint-plugin-node ^11.1.0
expect ^27.3.1
homedir-polyfill ^1.0.3
mocha ^6.1.4
normalize-path ^3.0.0
nyc ^15.1.0
resolve ^1.20.0

Keywords

file find find-up findup glob match pattern resolve search
Details
npm
2026-02-24 13:56:52 +00:00
1
Gulp Team
MIT
latest
2.9 KiB
Assets (1)
Versions (2) View all
5.0.0 2026-02-24
4.0.0 2026-02-24