Extension of @hoge1e3/fs which can access native file system in nw.js
npm install
npm run build
npm run test-browser
If "All test Passed." is shown, the test is succeeded.
To run this test, install nw package globally: npm nw -g
npm run test-nw
If "All test Passed." is shown, the test is succeeded.
npm run test-node
If "#1 test passed." is shown, the test is succeeded.
- If dist/FS.js is run in nw.js,
FS.get
represents files in native file system. - If dist/FS.js is run in regular browser,
FS.get
represents files in localStorage. - The file system can be selected by configuration see "Customize root file system".
var mydir=FS.get("/mydir/");// Directory in local file(Linux/Mac)
var mydir=FS.get("C:/mydir/");// Directory in local file(Windows)
If you want to use localStorage even in the nw.js environment,
call FS.init
before using FS.get
:
FS.init(new FS.LSFS(localStorage));
And if you want to use native file system, use FS.mount
.
FS.mount("/native/", new FS.NativeFS("/home/mydir/"));
After that FS.get("/native/test.txt")
represents native file of /home/mydir/test.txt
.