
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
vfile utility to check if a file passes a test.
This package is a small utility that checks that a file is a certain file.
Use this small utility if you find yourself repeating code for checking files.
This package is ESM only. In Node.js (version 16+), install with npm:
npm install vfile-is
In Deno with esm.sh:
import {is} from 'https://esm.sh/vfile-is@3'
In browsers with esm.sh:
<script type="module">
import {is} from 'https://esm.sh/vfile-is@3?bundle'
</script>
import {VFile} from 'to-vfile'
import {is} from 'vfile-is'
is(undefined, '.js') // => false
is({}, '.js') // => false
is(new VFile({path: 'index.js'}), '.js') // => true
is(new VFile({path: 'index.js'}), '.md') // => false
is(new VFile({path: 'index.js'}), 'index.js') // => true
is(new VFile({path: 'index.js'}), 'readme.md') // => false
is(new VFile({path: 'index.js'}), '*.js') // => true
is(new VFile({path: 'index.js'}), '*.md') // => false
is(new VFile({path: 'index.js'}), {stem: 'index'}) // => true
is(new VFile({path: 'index.js'}), {stem: 'readme'}) // => false
is(new VFile({path: 'index.js'}), {stem: {prefix: 'in'}}) // => true
is(new VFile({path: 'index.js'}), {stem: {prefix: 're'}}) // => false
is(new VFile({path: 'index.js'}), {stem: {suffix: 'ex'}}) // => true
is(new VFile({path: 'index.js'}), {stem: {suffix: 'me'}}) // => false
This package exports the identifiers convert and
is.
There is no default export.
convert(check)Create an assertion from check.
check (Check, optional)
— checkAssertion (Assert).
is(file, check?)Check if file is a specific file.
Converts check to an assertion and calls that assertion with file.
If you’re doing a lot of checks, use convert.
Whether file is a file and matches check (boolean).
AssertCheck that a file is a vfile and passes a test (TypeScript type).
file (unknown)
— file to check (typically VFile)Whether file is a file and matches a bound check (boolean).
CheckDifferent ways to check for a specific file (TypeScript type).
file.pathfile.basename or
file.extnametrue when calledCheckFieldstype Check =
| Array<CheckFields | CheckFile | string | null | undefined>
| CheckFields
| CheckFile
| string
| null
| undefined
CheckFieldsObject describing fields to values (TypeScript type).
Each key is a field in the file and each value is:
boolean — whether the field exists or notobject — start (prefix) and/or end (suffix) of the fieldstring — exact value of that fieldtype FieldPartial = {
prefix?: string | null | undefined
suffix?: string | null | undefined
}
type CheckFields = Record<
string,
FieldPartial | boolean | string | null | undefined
>
CheckFileCheck if a file passes a custom test (TypeScript type).
file (VFile)
— file to checkWhether the test passed for this file (boolean, optional).
This package is fully typed with TypeScript.
It exports the additional types Assert, Check,
CheckFields, and CheckFile.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, vfile-is@^3, compatible
with Node.js 16.
See contributing.md in vfile/.github for ways to
get started.
See support.md for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
vfile utility to check if a vfile passes a test
We found that vfile-is demonstrated a not healthy version release cadence and project activity because the last version was released 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.