memory-fs
A simple in-memory filesystem. Holds data in a javascript object.
Last updated 6 months ago by sokra .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install memory-fs 
SYNC missed versions from official npm registry.

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)

Current Tags

  • 0.5.0                                ...           latest (6 months ago)

7 Versions

  • 0.5.0                                ...           6 months ago
  • 0.4.1                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 13,132
This Week 191,040
This Month 101,103
Last Day 43,483
Last Week 257,621
Last Month 1,072,322
Dependencies (2)
Dev Dependencies (7)
Dependents (725)

Copyright 2014 - 2016 © taobao.org |