@teambit/any-fs
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,5 +6,5 @@ | ||
[code of conduct](https://js.foundation/community/code-of-conduct) & | ||
[search the issue tracker](https://github.com/teambit/anyFS/issues); your issue | ||
[search the issue tracker](https://github.com/teambit/any-fs/issues); your issue | ||
may have already been discussed or fixed in `master`. To contribute, | ||
[fork](https://help.github.com/articles/fork-a-repo/) anyFS, commit your changes, | ||
[fork](https://help.github.com/articles/fork-a-repo/) any-fs, commit your changes, | ||
& [send a pull request](https://help.github.com/articles/using-pull-requests/). | ||
@@ -15,7 +15,7 @@ | ||
Feature requests should be submitted in the | ||
[issue tracker](https://github.com/teambit/anyFS/issues), with a description of | ||
[issue tracker](https://github.com/teambit/any-fs/issues), with a description of | ||
the expected behavior & use case. | ||
Before submitting a request, please search for similar ones in the | ||
[closed issues](https://github.com/teambit/anyFS/issues?q=is%3Aissue+is%3Aclosed). | ||
[closed issues](https://github.com/teambit/any-fs/issues?q=is%3Aissue+is%3Aclosed). | ||
@@ -22,0 +22,0 @@ |
@@ -0,2 +1,2 @@ | ||
export { AnyFS } from './node'; | ||
export * from './volumes'; | ||
export * from './node'; |
@@ -1,2 +0,2 @@ | ||
export * from './volume'; | ||
export { NodeFs } from './node-fs'; | ||
export * from './promises'; |
@@ -6,4 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./volume")); | ||
var node_fs_1 = require("./node-fs"); | ||
exports.NodeFs = node_fs_1.NodeFs; | ||
__export(require("./promises")); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import { Dirent, FS, FSWatcher, MakeDirectoryOptions, PromisesAPI, ReadStream, Stats, WriteStream } from '../../node'; | ||
import { Dirent, AnyFS, FSWatcher, MakeDirectoryOptions, ReadStream, Stats, WriteStream } from '../../node'; | ||
import { PathLike } from 'fs'; | ||
import { Volume as _Volume } from 'memfs/lib/volume'; | ||
export declare class MemoryFS implements FS { | ||
promises: PromisesAPI; | ||
import { Volume as _Volume, TFilePath } from 'memfs/lib/volume'; | ||
export declare class MemoryFS implements AnyFS { | ||
volume: _Volume; | ||
constructor(promises?: PromisesAPI); | ||
readonly promises: import("memfs/lib/promises").IPromisesAPI; | ||
access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException | null) => void): void; | ||
@@ -18,2 +17,3 @@ access(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void; | ||
appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void; | ||
mkdirpSync(path: TFilePath): void; | ||
appendFileSync(file: PathLike | number, data: any, options?: { | ||
@@ -20,0 +20,0 @@ encoding?: string | null; |
@@ -5,6 +5,6 @@ "use strict"; | ||
class MemoryFS { | ||
// @ts-ignore | ||
constructor(promises = this.volume.promises) { | ||
this.promises = promises; | ||
constructor() { | ||
this.volume = new memfs_1.Volume(); | ||
// @ts-ignore | ||
this.promises = this.volume.promises; | ||
} | ||
@@ -22,2 +22,5 @@ access(path, mode, callback) { | ||
} | ||
mkdirpSync(path) { | ||
this.volume.mkdirpSync(path); | ||
} | ||
appendFileSync(file, data, options) { | ||
@@ -24,0 +27,0 @@ // @ts-ignore |
{ | ||
"name": "@teambit/any-fs", | ||
"version": "0.0.1", | ||
"description": "anyfs is a composable and extendible file-system and fully compatible with the node `fs` module.", | ||
"version": "0.0.2", | ||
"description": "any-fs is a composable and extendible file-system and fully compatible with the node `fs` module.", | ||
"repository": "teambit/any-fs", | ||
@@ -15,6 +15,4 @@ "main": "dist/index.js", | ||
}, | ||
"devDependencies": { | ||
"@types/node": "13.1.4", | ||
"prettier": "1.19.1", | ||
@@ -21,0 +19,0 @@ "ts-node": "8.5.4", |
@@ -1,5 +0,5 @@ | ||
# anyfs | ||
# any-fs | ||
![npm](https://img.shields.io/npm/l/anyfs.svg?style=flat-square) | ||
anyfs is a composable and extendible file-system and fully compatible with the node `fs` module. | ||
any-fs is a composable and extendible file-system and fully compatible with the node `fs` module. | ||
@@ -9,3 +9,3 @@ ## Usage | ||
```js | ||
var { MemoryFS } = require('@teambit/anyfs'); | ||
var { MemoryFS } = require('@teambit/any-fs'); | ||
const fs = new MemoryFS() | ||
@@ -16,3 +16,3 @@ fs.writeFile() | ||
```js | ||
var { Volume } = require('@teambit/anyfs'); | ||
var { Volume } = require('@teambit/any-fs'); | ||
const fs = new Volume() | ||
@@ -19,0 +19,0 @@ fs.writeFile() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203620
2868