fs-in-memory

fs-in-memory JS library on npm Download fs-in-memory JS library

This module provides an in-memory implementation of the `fs` module. Functions and behaviour are added as required, so this is far from being a complete implementation. Patches and pull requests to add functions and make behaviour more realistic are very welcome!

Version 0.1.1
fs-in-memory has no homepage
fs-in-memory JS library on GitHub
fs-in-memory JS library on npm
Download fs-in-memory JS library
<script type="module"> import fsInMemory from 'https://cdn.jsdelivr.net/npm/fs-in-memory@0.1.1/+esm' </script>
Learn more

node-fs-in-memory

This module provides an in-memory implementation of the fs module. Functions and behaviour are added as required, so this is far from being a complete implementation. Patches and pull requests to add functions and make behaviour more realistic are very welcome!

Example

var fsInMemory = require("fs-in-memory)";
var fs = fsInMemory.create();
fs.writeFile("/name", "Bob", function(err) {
    fs.readFile("/name", "utf8", function(err, contents) {
        // contents === "Bob"
    });
});

Implemented functions

fs.readFile

fs.readdir

fs.exists

fs.mkdir

fs.writeFile