provides a subset of node fs functions to be used by fs-rpc
Only asynchronous methods are available.
import fs from "rpc-fs"
import {rpcfs: fs} from "rpc-fs"
await fs.mkdir('/dirA');
mkdir -p
fs.mkdirp('/not/existing/pathname');
rm -rf dirA
fs.rmrf('/dirA');
readdir() and stat() combined
await fs.readdirStats('/dirA')
-> {
"file1": {isDirectory: false, isFile: true, size: 42, mtime: 1448884388662, ..},
"dir 2": {isDirectory: true, isFile: false, size: 42, mtime: 1448884388663, ..}
}
$ npm i rpc-fs
$ npm test
or watch:
$ npm watch