Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mem-fs
Advanced tools
Readme
Simple in-memory vinyl file store.
You access a file using store#get()
method. If the file is in memory, it will be used. Otherwise, we'll load the file from the file-system.
import { create } from 'mem-fs';
const store = create();
store.get('/test/file.txt');
When trying to load a file we cannot read from disk, an empty Vinyl file will be returned. The contents
of this file will be set to null
.
Trying to get a directory or any invalid files will also return an empty Vinyl file pointer.
You update file references by using store#add()
method. This method take a vinyl
file object as parameter.
import File from 'vinyl';
import { create } from 'mem-fs';
const coffeeFile = new File({
cwd: '/',
base: '/test/',
path: '/test/file.coffee',
contents: new Buffer('test = 123'),
});
const store = create();
store.add(coffeeFile);
Using store#each(cb(file, index))
, you can iterate over every file stored in the file system.
Using store#all()
, you can get every file stored in the file system.
Using store#existsInMemory()
, you can check if the file already exists in the file system without loading it from disk.
Using store#stream()
, you can create a stream with every file stored in the file system.
store#pipeline()
generates a new map with yielded files in transforms.
If no transform is passed, files references are updated.
FAQs
Simple in-memory vinyl file store
The npm package mem-fs receives a total of 766,447 weekly downloads. As such, mem-fs popularity was classified as popular.
We found that mem-fs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.