Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mem-fs

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mem-fs - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

27

index.js

@@ -7,3 +7,3 @@ 'use strict';

var File = require('vinyl');
var through = require('through2');
const { PassThrough } = require('stream')

@@ -13,2 +13,11 @@ exports.create = function () {

function createFile(filepath) {
return new File({
cwd: process.cwd(),
base: process.cwd(),
path: filepath,
contents: null
});
}
function load(filepath) {

@@ -19,8 +28,3 @@ var file;

} catch (err) {
file = new File({
cwd: process.cwd(),
base: process.cwd(),
path: filepath,
contents: null
});
file = createFile(filepath);
}

@@ -41,2 +45,7 @@ store[filepath] = file;

Store.prototype.existsInMemory = function (filepath) {
filepath = path.resolve(filepath);
return !!store[filepath];
};
Store.prototype.add = function (file) {

@@ -56,5 +65,5 @@ store[file.path] = file;

Store.prototype.stream = function () {
var stream = through.obj();
const stream = new PassThrough({objectMode: true, autoDestroy: true});
setImmediate(function () {
this.each(stream.write.bind(stream));
this.each((file) => stream.write(file));
stream.end();

@@ -61,0 +70,0 @@ }.bind(this));

{
"name": "mem-fs",
"version": "1.2.0",
"version": "2.0.0",
"description": "Simple in-memory vinyl file store",

@@ -15,3 +15,2 @@ "scripts": {

"dependencies": {
"through2": "^3.0.0",
"vinyl": "^2.0.1",

@@ -21,4 +20,7 @@ "vinyl-file": "^3.0.0"

"devDependencies": {
"mocha": "^5.0.0"
"mocha": "^8.3.2"
},
"engines": {
"node": ">=12"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc