Skip to content
A simple in-memory filesystem. Holds data in a javascript object.
Branch: master
Clone or download
Latest commit 7ae73eb Oct 2, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib linting fixes Jun 14, 2017
test Fix invalid path test to fail on the invalid path instead of undefine… Sep 14, 2017
.editorconfig Added ESlint and EditorConfig Nov 17, 2016
.eslintrc.json linting fixes Jun 14, 2017
.gitattributes
.gitignore Initial commit Jul 1, 2014
.travis.yml linting fixes Jun 14, 2017
LICENSE Add LICENSE file Dec 7, 2016
README.md Typo in README.md ("variantes" -> "variants") Feb 4, 2016
package.json linting fixes Jun 14, 2017

README.md

memory-fs

A simple in-memory filesystem. Holds data in a javascript object.

var MemoryFileSystem = require("memory-fs");
var fs = new MemoryFileSystem(); // Optionally pass a javascript object

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

// Async variants too
fs.unlink("/a/test/dir/file.txt", function(err) {
	// ...
});

fs.readdirSync("/a/test"); // returns ["dir"]
fs.statSync("/a/test/dir").isDirectory(); // returns true
fs.rmdirSync("/a/test/dir");

fs.mkdirpSync("C:\\use\\windows\\style\\paths");

License

Copyright (c) 2012-2014 Tobias Koppers

MIT (http://www.opensource.org/licenses/mit-license.php)

You can’t perform that action at this time.