findup-sync
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
detect-file | 1.0.0 | 3.33 kB | MIT | prod | |
is-glob | 4.0.3 | 4.16 kB | MIT | prod | |
micromatch | 4.0.5 | 14.09 kB | MIT | prod | |
resolve-dir | 1.0.1 | 2.5 kB | MIT | prod |
Findup-sync is a useful package in npm that helps users find the first file matching a given pattern. It either looks up in the current working directory or any nearest parent directories. This functionality is achieved through pattern matching with micromatch, a globbing library for node.js. All matching-related issues should be reported on the micromatch's repository.
Findup-sync is used through a JavaScript interface after installing it from npm. After requiring ('findup-sync') in your JavaScript file, you can pass your file pattern or patterns to the findup function. The function also accepts additional micromatch options. Here are some example usage scenarios:
// Import Findup-sync
var findup = require('findup-sync');
// Look for a file matching the pattern in the current working directory
var filepath1 = findup('{a,b}*.txt');
// Look for a file matching the pattern in a specified directory, ignoring case sensitivity
var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});
In these examples, '{a,b}*.txt' is the file pattern (this would match any .txt files starting with 'a' or 'b'), cwd
specifies a different directory than the current one to start the search from, and nocase
set to true makes the search case-insensitive.
The best source for Findup-sync's documentation is on its GitHub page, git+https://github.com/gulpjs/findup-sync.git, and directly on the npm website. These sources provide detailed information on installing and using the package, options that it accepts for operation, as well as troubleshooting guidance. The Usage, API section in the readme file on the GitHub repository gives a concise summary of the package's functionality and its interface.