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


\begin{DoxyCode}{0}
\DoxyCodeLine{var MemoryFileSystem = require("{}memory-\/fs"{});}
\DoxyCodeLine{var fs = new MemoryFileSystem(); // Optionally pass a javascript object}
\DoxyCodeLine{}
\DoxyCodeLine{fs.mkdirpSync("{}/a/test/dir"{});}
\DoxyCodeLine{fs.writeFileSync("{}/a/test/dir/file.txt"{}, "{}Hello World"{});}
\DoxyCodeLine{fs.readFileSync("{}/a/test/dir/file.txt"{}); // returns Buffer("{}Hello World"{})}
\DoxyCodeLine{}
\DoxyCodeLine{// Async variants too}
\DoxyCodeLine{fs.unlink("{}/a/test/dir/file.txt"{}, function(err) \{}
\DoxyCodeLine{    // ...}
\DoxyCodeLine{\});}
\DoxyCodeLine{}
\DoxyCodeLine{fs.readdirSync("{}/a/test"{}); // returns ["{}dir"{}]}
\DoxyCodeLine{fs.statSync("{}/a/test/dir"{}).isDirectory(); // returns true}
\DoxyCodeLine{fs.rmdirSync("{}/a/test/dir"{});}
\DoxyCodeLine{}
\DoxyCodeLine{fs.mkdirpSync("{}C:\(\backslash\)\(\backslash\)use\(\backslash\)\(\backslash\)windows\(\backslash\)\(\backslash\)style\(\backslash\)\(\backslash\)paths"{}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_webpack_dev_middleware_node_modules_memory_fs_README_autotoc_md33124}{}\doxysection{License}\label{md_sfcode_node_modules_webpack_dev_middleware_node_modules_memory_fs_README_autotoc_md33124}
Copyright (c) 2012-\/2014 Tobias Koppers

MIT (\href{http://www.opensource.org/licenses/mit-license.php}{\texttt{ http\+://www.\+opensource.\+org/licenses/mit-\/license.\+php}}) 