JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11094383
  • Score
    100M100P100Q218739F
  • License MIT

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

Package Exports

  • memory-fs
  • memory-fs/lib/MemoryFileSystem
  • memory-fs/lib/join
  • memory-fs/lib/normalize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (memory-fs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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 variantes 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)