Comparing version 2.0.2 to 2.0.3
{ | ||
"name": "memfs", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "In-memory file-system with Node's fs API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
186
README.md
@@ -15,2 +15,3 @@ # memfs 2.0 | ||
- Permissions may* be implemented in the future | ||
- Can be used in browser, see `memfs-webpack` | ||
@@ -71,2 +72,5 @@ Usage: | ||
vol.readFileSync('/foo'); // bar | ||
const vol2 = Volume.fromJSON({'/foo': 'bar 2'}); | ||
vol2.readFileSync('/foo'); // bar 2 | ||
``` | ||
@@ -117,8 +121,8 @@ | ||
`vol` is an instance of `Volume` constructor, it is a default volume created | ||
for your convenience. `fs` in an *fs-like* object created from `vol` using | ||
`vol` is an instance of `Volume` constructor, it is the default volume created | ||
for your convenience. `fs` is an *fs-like* object created from `vol` using | ||
`createFsFromVolume(vol)`, see reference below. | ||
All contents of the `fs` object are also exported individually, so you can use | ||
`memfs` just like you would `fs` module: | ||
`memfs` just like you would use the `fs` module: | ||
@@ -189,3 +193,3 @@ ```js | ||
`json` is an optional object parameter where the list of files will be added. | ||
`json` is an optional object parameter which will be populated with the exported files. | ||
@@ -196,3 +200,3 @@ `isRelative` is boolean that specifies if returned paths should be relative. | ||
Creates a directory tree recursively. `path` is specifies a directory to | ||
Creates a directory tree recursively. `path` specifies a directory to | ||
create and can be a string, `Buffer`, or an `URL` object. `callback` is | ||
@@ -203,3 +207,3 @@ called on completion and may receive only one argument - an `Error` object. | ||
A synchronous version of `vol.mkdirp`. This method throws. | ||
A synchronous version of `vol.mkdirp()`. This method throws. | ||
@@ -231,87 +235,91 @@ #### `createFsFromVolume(vol)` | ||
- [x] Constants | ||
- [x] `FSWatcher` | ||
- [x] `ReadStream` | ||
- [x] `WriteStream` | ||
- [x] `Stats` | ||
- [x] `access(path[, mode], callback)` | ||
- Does not check permissions | ||
- [x] `accessSync(path[, mode])` | ||
- Does not check permissions | ||
- [x] `appendFile(file, data[, options], callback)` | ||
- [x] `appendFileSync(file, data[, options])` | ||
- [x] `chmod(path, mode, callback)` | ||
- [x] `chmodSync(path, mode)` | ||
- [x] `chown(path, uid, gid, callback)` | ||
- [x] `chownSync(path, uid, gid)` | ||
- [x] `close(fd, callback)` | ||
- [x] `closeSync(fd)` | ||
- [x] `createReadStream(path[, options])` | ||
- [x] `createWriteStream(path[, options])` | ||
- [x] `exists(path, callback)` | ||
- [x] `existsSync(path)` | ||
- [x] `fchmod(fd, mode, callback)` | ||
- [x] `fchmodSync(fd, mode)` | ||
- [x] `fchown(fd, uid, gid, callback)` | ||
- [x] `fchownSync(fd, uid, gid)` | ||
- [x] `fdatasync(fd, callback)` | ||
- [x] `fdatasyncSync(fd)` | ||
- [x] `fstat(fd, callback)` | ||
- [x] `fstatSync(fd)` | ||
- [x] `fsync(fd, callback)` | ||
- [x] `fsyncSync(fd)` | ||
- [x] `ftruncate(fd[, len], callback)` | ||
- [x] `ftruncateSync(fd[, len])` | ||
- [x] `futimes(fd, atime, mtime, callback)` | ||
- [x] `futimesSync(fd, atime, mtime)` | ||
- [x] `lchmod(path, mode, callback)` | ||
- [x] `lchmodSync(path, mode)` | ||
- [x] `lchown(path, uid, gid, callback)` | ||
- [x] `lchownSync(path, uid, gid)` | ||
- [x] `link(existingPath, newPath, callback)` | ||
- [x] `linkSync(existingPath, newPath)` | ||
- [x] `lstat(path, callback)` | ||
- [x] `lstatSync(path)` | ||
- [x] `mkdir(path[, mode], callback)` | ||
- [x] `mkdirSync(path[, mode])` | ||
- [x] `mkdtemp(prefix[, options], callback)` | ||
- [x] `mkdtempSync(prefix[, options])` | ||
- [x] `open(path, flags[, mode], callback)` | ||
- [x] `openSync(path, flags[, mode])` | ||
- [x] `read(fd, buffer, offset, length, position, callback)` | ||
- [x] `readSync(fd, buffer, offset, length, position)` | ||
- [x] `readdir(path[, options], callback)` | ||
- [x] `readdirSync(path[, options])` | ||
- [x] `readFile(path[, options], callback)` | ||
- [x] `readFileSync(path[, options])` | ||
- [x] `readlink(path[, options], callback)` | ||
- [x] `readlinkSync(path[, options])` | ||
- [x] `realpath(path[, options], callback)` | ||
- [x] `realpathSync(path[, options])` | ||
- Caching not implemented | ||
- [x] `rename(oldPath, newPath, callback)` | ||
- [x] `renameSync(oldPath, newPath)` | ||
- [x] `rmdir(path, callback)` | ||
- [x] `rmdirSync(path)` | ||
- [x] `stat(path, callback)` | ||
- [x] `statSync(path)` | ||
- [x] `symlink(target, path[, type], callback)` | ||
- [x] `symlinkSync(target, path[, type])` | ||
- [x] `truncate(path[, len], callback)` | ||
- [x] `truncateSync(path[, len])` | ||
- [x] `unlink(path, callback)` | ||
- [x] `unlinkSync(path)` | ||
- [x] `utimes(path, atime, mtime, callback)` | ||
- [x] `utimesSync(path, atime, mtime)` | ||
- [x] `watch(filename[, options][, listener])` | ||
- [x] `watchFile(filename[, options], listener)` | ||
- [x] `unwatchFile(filename[, listener])` | ||
- [x] `write(fd, buffer[, offset[, length[, position]]], callback)` | ||
- [x] `write(fd, string[, position[, encoding]], callback)` | ||
- [x] `writeFile(file, data[, options], callback)` | ||
- [x] `writeFileSync(file, data[, options])` | ||
- [x] `writeSync(fd, buffer[, offset[, length[, position]]])` | ||
- [x] `writeSync(fd, string[, position[, encoding]])` | ||
All of the [Node's `fs` API](https://nodejs.org/api/fs.html) is implemented. | ||
Some error messages may be inaccurate. File permissions are currently not | ||
implemented (you have access to any file), basically `fs.access()` is a no-op. | ||
- [x] Constants | ||
- [x] `FSWatcher` | ||
- [x] `ReadStream` | ||
- [x] `WriteStream` | ||
- [x] `Stats` | ||
- [x] `access(path[, mode], callback)` | ||
- Does not check permissions | ||
- [x] `accessSync(path[, mode])` | ||
- Does not check permissions | ||
- [x] `appendFile(file, data[, options], callback)` | ||
- [x] `appendFileSync(file, data[, options])` | ||
- [x] `chmod(path, mode, callback)` | ||
- [x] `chmodSync(path, mode)` | ||
- [x] `chown(path, uid, gid, callback)` | ||
- [x] `chownSync(path, uid, gid)` | ||
- [x] `close(fd, callback)` | ||
- [x] `closeSync(fd)` | ||
- [x] `createReadStream(path[, options])` | ||
- [x] `createWriteStream(path[, options])` | ||
- [x] `exists(path, callback)` | ||
- [x] `existsSync(path)` | ||
- [x] `fchmod(fd, mode, callback)` | ||
- [x] `fchmodSync(fd, mode)` | ||
- [x] `fchown(fd, uid, gid, callback)` | ||
- [x] `fchownSync(fd, uid, gid)` | ||
- [x] `fdatasync(fd, callback)` | ||
- [x] `fdatasyncSync(fd)` | ||
- [x] `fstat(fd, callback)` | ||
- [x] `fstatSync(fd)` | ||
- [x] `fsync(fd, callback)` | ||
- [x] `fsyncSync(fd)` | ||
- [x] `ftruncate(fd[, len], callback)` | ||
- [x] `ftruncateSync(fd[, len])` | ||
- [x] `futimes(fd, atime, mtime, callback)` | ||
- [x] `futimesSync(fd, atime, mtime)` | ||
- [x] `lchmod(path, mode, callback)` | ||
- [x] `lchmodSync(path, mode)` | ||
- [x] `lchown(path, uid, gid, callback)` | ||
- [x] `lchownSync(path, uid, gid)` | ||
- [x] `link(existingPath, newPath, callback)` | ||
- [x] `linkSync(existingPath, newPath)` | ||
- [x] `lstat(path, callback)` | ||
- [x] `lstatSync(path)` | ||
- [x] `mkdir(path[, mode], callback)` | ||
- [x] `mkdirSync(path[, mode])` | ||
- [x] `mkdtemp(prefix[, options], callback)` | ||
- [x] `mkdtempSync(prefix[, options])` | ||
- [x] `open(path, flags[, mode], callback)` | ||
- [x] `openSync(path, flags[, mode])` | ||
- [x] `read(fd, buffer, offset, length, position, callback)` | ||
- [x] `readSync(fd, buffer, offset, length, position)` | ||
- [x] `readdir(path[, options], callback)` | ||
- [x] `readdirSync(path[, options])` | ||
- [x] `readFile(path[, options], callback)` | ||
- [x] `readFileSync(path[, options])` | ||
- [x] `readlink(path[, options], callback)` | ||
- [x] `readlinkSync(path[, options])` | ||
- [x] `realpath(path[, options], callback)` | ||
- [x] `realpathSync(path[, options])` | ||
- Caching not implemented | ||
- [x] `rename(oldPath, newPath, callback)` | ||
- [x] `renameSync(oldPath, newPath)` | ||
- [x] `rmdir(path, callback)` | ||
- [x] `rmdirSync(path)` | ||
- [x] `stat(path, callback)` | ||
- [x] `statSync(path)` | ||
- [x] `symlink(target, path[, type], callback)` | ||
- [x] `symlinkSync(target, path[, type])` | ||
- [x] `truncate(path[, len], callback)` | ||
- [x] `truncateSync(path[, len])` | ||
- [x] `unlink(path, callback)` | ||
- [x] `unlinkSync(path)` | ||
- [x] `utimes(path, atime, mtime, callback)` | ||
- [x] `utimesSync(path, atime, mtime)` | ||
- [x] `watch(filename[, options][, listener])` | ||
- [x] `watchFile(filename[, options], listener)` | ||
- [x] `unwatchFile(filename[, listener])` | ||
- [x] `write(fd, buffer[, offset[, length[, position]]], callback)` | ||
- [x] `write(fd, string[, position[, encoding]], callback)` | ||
- [x] `writeFile(file, data[, options], callback)` | ||
- [x] `writeFileSync(file, data[, options])` | ||
- [x] `writeSync(fd, buffer[, offset[, length[, position]]])` | ||
- [x] `writeSync(fd, string[, position[, encoding]])` | ||
[npm-url]: https://www.npmjs.com/package/memfs | ||
@@ -318,0 +326,0 @@ [npm-img]: https://img.shields.io/npm/v/memfs.svg |
297709
355