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 Apr 28, 2024 via pnpm

memory-fs 0.5.0

A simple in-memory filesystem. Holds data in a javascript object.
Package summary
Share
0
issues
2
licenses
10
MIT
1
ISC
Package created
1 Jul 2014
Version published
8 Oct 2019
Maintainers
1
Total deps
11
Direct deps
2
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
10 Packages, Including:
core-util-is@1.0.3
errno@0.1.8
isarray@1.0.0
memory-fs@0.5.0
process-nextick-args@2.0.1
prr@1.0.1
readable-stream@2.3.8
safe-buffer@5.1.2
string_decoder@1.1.1
util-deprecate@1.0.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
inherits@2.0.4
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

2
All Dependencies CSV
β“˜ This is a list of memory-fs 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
errno0.1.86.17 kBMIT
prod
readable-stream2.3.825.14 kBMIT
prod

Visualizations

Frequently Asked Questions

What does memory-fs do?

Memory-fs is a simple in-memory filesystem implemented in JavaScript. It stores data within a JavaScript object, functioning analogously to a regular file system. This can be particularly useful in scenarios where persistence of data is not required, such as caching files or during testing operations.

How do you use memory-fs?

Here's a basic usage example of memory-fs in JavaScript:

First, you'll need to install it with npm (npm install --save memory-fs).

After that, you can utilize memory-fs in your code as follows:

//Require memory-fs
var MemoryFileSystem = require("memory-fs");

//Create a new memory file system
var fs = new MemoryFileSystem(); 

//Creating a directory
fs.mkdirpSync("/a/test/dir");

//Creating a file and writing to it
fs.writeFileSync("/a/test/dir/file.txt", "Hello World");

//Reading from the file
fs.readFileSync("/a/test/dir/file.txt"); 

//You can also delete files asynchronously 
fs.unlink("/a/test/dir/file.txt", function(err) {
	//Handle error
});

//Checking contents of a directory
fs.readdirSync("/a/test");

//Checking the type of item: file or directory
fs.statSync("/a/test/dir").isDirectory();

//Removing a directory
fs.rmdirSync("/a/test/dir");

//Creating a directory with Windows path style
fs.mkdirpSync("C:\\use\\windows\\style\\paths");

Please note that memory-fs provides both synchronous and asynchronous function variants for file system operations.

Where are the memory-fs docs?

Documentation for memory-fs is currently somewhat sparse. The README file from its GitHub repository (https://github.com/webpack/memory-fs) serves as the primary source of available documentation. You may find the common JavaScript File System method names and conventions to be a useful guide, as memory-fs implements these standards.