You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File edition helpers working on top of [mem-fs](https://github.com/SBoudrias/mem-fs)
5
4
6
-
Usage
7
-
-------------
5
+
## Usage
8
6
9
7
```js
10
-
var memFs =require('mem-fs');
11
-
var editor =require('mem-fs-editor');
8
+
var memFs =require("mem-fs");
9
+
var editor =require("mem-fs-editor");
12
10
13
11
var store =memFs.create();
14
12
var fs =editor.create(store);
15
13
16
-
fs.write('somefile.js', 'var a = 1;');
14
+
fs.write("somefile.js", "var a = 1;");
17
15
```
18
16
19
17
### `#read(filepath, [options])`
@@ -61,7 +59,7 @@ Optionally take the same JSON formatting arguments than `#writeJSON()`.
61
59
62
60
Delete a file or a directory.
63
61
64
-
`filePath` can also be a `glob`. If `filePath` is glob, you can optionally pass in an `options.globOptions` object to change its pattern matching behavior. The full list of options are being described [here](https://github.com/isaacs/node-glob#options). The `sync` flag is forced to be `true` in `globOptions`.
62
+
`filePath` can also be a `glob`. If `filePath` is glob, you can optionally pass in an `options.globOptions` object to change its pattern matching behavior. The full list of options are being described [here](https://github.com/mrmlnc/fast-glob#options-1). The `sync` flag is forced to be `true` in `globOptions`.
65
63
66
64
### `#copy(from, to, [options], context[, templateOptions ])`
67
65
@@ -71,7 +69,7 @@ Optionally, pass an `options.process` function (`process(contents)`) returning a
71
69
72
70
`option.ignoreNoMatch` can be used to silence the error thrown if no files match the `from` pattern.
73
71
74
-
`from` can be a glob pattern that'll be match against the file system. If that's the case, then `to` must be an output directory. For a globified `from`, you can optionally pass in an `options.globOptions` object to change its pattern matching behavior. The full list of options are being described [here](https://github.com/isaacs/node-glob#options). The `nodir` flag is forced to be `true` in `globOptions` to ensure a vinyl object representing each matching directory is marked as `deleted` in the `mem-fs` store.
72
+
`from` can be a glob pattern that'll be match against the file system. If that's the case, then `to` must be an output directory. For a globified `from`, you can optionally pass in an `options.globOptions` object to change its pattern matching behavior. The full list of options are being described [here](https://github.com/mrmlnc/fast-glob#options-1). The `nodir` flag is forced to be `true` in `globOptions` to ensure a vinyl object representing each matching directory is marked as `deleted` in the `mem-fs` store.
75
73
76
74
### `#copyTpl(from, to, context[, templateOptions [, copyOptions]])`
77
75
@@ -87,7 +85,9 @@ Templates syntax looks like this:
0 commit comments