Vinyl adapter for the file system providing streaming file operations.
npx @tessl/cli install tessl/npm-vinyl-fs@4.0.0vinyl-fs is a Vinyl adapter for the file system that provides streaming file operations. It serves as a bridge between the file system and Vinyl (a virtual file format), offering three main methods for file manipulation through Node.js streams with support for glob patterns, sourcemaps, encoding transformations, and symbolic links.
npm install vinyl-fsconst vfs = require('vinyl-fs');For ES modules:
import vfs from 'vinyl-fs';Individual imports:
const { src, dest, symlink } = require('vinyl-fs');const vfs = require('vinyl-fs');
// Read files using glob patterns and write to destination
vfs.src(['./src/**/*.js', '!./src/vendor/*.js'])
.pipe(vfs.dest('./output'));
// Create symbolic links
vfs.src('./src/**/*.js')
.pipe(vfs.symlink('./links'));vinyl-fs is built around the Vinyl ecosystem and Node.js streams:
Stream-based file reading with glob pattern support, encoding transformation, and sourcemap handling. Perfect for build systems and file processing workflows.
function src(globs, options);Stream-based file writing with directory creation, permission handling, and sourcemap support. Automatically creates directories and preserves file metadata.
function dest(outFolder, options);Stream-based symbolic link creation with support for both file and directory symlinks, including Windows junction support.
function symlink(outFolder, options);