Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
vfile-find-up
Advanced tools
Find vfiles by searching the file system upwards.
npm:
npm install vfile-find-up
var findUp = require('vfile-find-up')
findUp.all('package.json', console.log)
Yields:
null [ VFile {
data: {},
messages: [],
history: [ '/Users/tilde/projects/oss/vfile-find-up/package.json' ],
cwd: '/Users/tilde/projects/oss/vfile-find-up' } ]
findUp.all(tests[, path], callback)
Search for tests
upwards. Invokes callback with either an error
or an array of files passing tests
.
Note: Virtual Files are not read (their contents
is not populated).
tests
Things to search for (string|Function|Array.<tests>
).
If a string
is passed in, the basename
or extname
of files
must match it for them to be included.
If an array is passed in, any test must match a given file for it to be included.
Otherwise, they must be function
.
path
Place to searching from (string
, default: process.cwd()
).
callback
Function invoked with all matching files (function cb(err[, files])
).
findUp.one(tests[, path], callback)
Like findUp.all
, but invokes callback
with the first found
file, or null
.
function test(file)
Check whether a virtual file should be included. Invoked with a vfile.
true
or findUp.INCLUDE
— Include the file in the results;findUp.BREAK
— Stop searching for files;The different flags can be combined by using the pipe operator:
findUp.INCLUDE | findUp.BREAK
.
See contributing.md
in vfile/vfile
for ways to get started.
This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.
FAQs
vfile utility to find one or more files by searching the file system upwards
The npm package vfile-find-up receives a total of 22,655 weekly downloads. As such, vfile-find-up popularity was classified as popular.
We found that vfile-find-up demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.