Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 10, 2024 via pnpm

vfile 5.3.7

Virtual file format for text processing
Package summary
Share
0
issues
1
license
5
MIT
Package created
26 Jul 2015
Version published
8 Feb 2023
Maintainers
1
Total deps
5
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
@types/unist@2.0.10
is-buffer@2.0.5
unist-util-stringify-position@3.0.3
vfile-message@3.1.4
vfile@5.3.7
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of vfile 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@types/unist2.0.102.5 kBMIT
prod
is-buffer2.0.52.04 kBMIT
prod
unist-util-stringify-position3.0.34.2 kBMIT
prod
vfile-message3.1.45.66 kBMIT
prod

Visualizations

Frequently Asked Questions

What does vfile do?

Vfile is a small and browser-friendly virtual file format that tracks metadata about files such as its path and value, as well as lint messages. This package offers a useful API for accessing file value, path, and metadata, and it is specifically designed to support attaching lint messages and errors to specific parts of these files. It is especially useful when dealing with a concept of files in situations where you may not be able to access the file system. It is designed for the unified ecosystem, but can also be used in other projects which deal with parsing, transforming, and serializing data, for example, to create linters, compilers, static site generators, and other building tools.

How do you use vfile?

To use Vfile, you will need to install it. In Node.js (version 16+), it can be installed via npm:

npm install vfile

You can utilize VFile in your JavaScript code:

import {VFile} from 'vfile'

const file = new VFile({
  path: '~/example.txt',
  value: 'Alpha *braavo* charlie.'
})

//You can manipulate and access file properties such as path, dirname, and basename:

console.log(file.path) // => '~/example.txt'
console.log(file.dirname) // => '~'

file.extname = '.md'

console.log(file.basename) // => 'example.md'

file.basename = 'index.text'

console.log(file.history) // => ['~/example.txt', '~/example.md', '~/index.text']

//You can also add lint messages to the file:

file.message('Unexpected unknown word `braavo`, did you mean `bravo`?', {
  place: {line: 1, column: 8},
  source: 'spell',
  ruleId: 'typo'
})

console.log(file.messages)

Where are the vfile docs?

The Vfile documentation can be found at this GitHub link. The readme at the provided location is very detailed, containing installation instructions, various usability examples, and a detailed API reference.