Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webpack/memory-fs
[DEPRECATED use memfs instead] A simple in-memory filesystem. Holds data in a javascript object.
https://github.com/webpack/memory-fs
Last synced: 2 months ago
JSON representation
[DEPRECATED use memfs instead] A simple in-memory filesystem. Holds data in a javascript object.
- Host: GitHub
- URL: https://github.com/webpack/memory-fs
- Owner: webpack
- License: mit
- Created: 2014-07-01T06:32:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T03:11:19.000Z (over 1 year ago)
- Last Synced: 2024-03-22T12:17:36.395Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 190 KB
- Stars: 882
- Watchers: 16
- Forks: 88
- Open Issues: 30
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - memory-fs - memory filesystem. Holds data in a javascript object. | webpack | 885 | (JavaScript)
README
# memory-fs
> DEPRECATED: use [memfs](https://github.com/streamich/memfs) instead.
A simple in-memory filesystem. Holds data in a javascript object.
``` javascript
var MemoryFileSystem = require("memory-fs");
var fs = new MemoryFileSystem(); // Optionally pass a javascript objectfs.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)