findup-sync (4.0.0)

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

Installation

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

About this package

findup-sync

NPM version Downloads Azure Pipelines Build Status Travis Build Status AppVeyor Build Status Coveralls Status Gitter chat

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.0
micromatch ^4.0.2
resolve-dir ^1.0.1

Development Dependencies

ID Version
coveralls github:phated/node-coveralls#2.x
eslint ^6.0.1
eslint-config-gulp ^3.0.1
expect ^1.20.2
homedir-polyfill ^1.0.1
mocha ^6.1.4
normalize-path ^3.0.0
nyc ^14.1.1
resolve ^1.4.0

Keywords

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