New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

memory-fs-stream

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memory-fs-stream

Convert memory-fs to stream

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
46
-30.3%
Maintainers
1
Weekly downloads
 
Created
Source

memory-fs-stream

License Travis Status npm

Convert memory-fs to Vinyl stream. Extracted from piped-webpack

API

const MemoryFileSystem = require('memory-fs');
const MemoryFSStream = require('memory-fs-stream');

let fs = new MemoryFileSystem();

fs.writeFileSync("/a/test/dir/file.txt", "Hello World");

let stream = new MemoryFSStream(fs);
// now stream will be vinyl stream of files in fs

Options

MemoryFSStream accept a second argument, an option object. Available options are:

  • root: Use file only from this subfolder. Default to use all files
  • close: Set to false to keep the stream open even after all files have been outputted. Useful when combined with modules that let you swap stream like duplexify
  • filter: List of files to include, default to all files. Can be specified as:
    • Array of full file path relative to the root (eg. ['path/to/file'])
    • Function which will receive full file path. Returning true means the file will be included.

License

memory-fs-stream is licensed under the MIT License

Keywords

vinyl

FAQs

Package last updated on 05 Oct 2017

Did you know?

Socket

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.

Install

Related posts