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
1.[`fs.utils.iconv`](https://www.npmjs.com/package/iconv-lite) - iconv-lite: Pure JS character encoding conversion library. See API docs here: https://www.npmjs.com/package/iconv-lite
334
+
2.[`fs.utils.anymatch`](https://github.com/micromatch/anymatch) - Javascript module to match a string against a regular expression, glob, string, or function that takes the string as an argument and returns a truthy or falsy value. The matcher can also be an array of any or all of these. Useful for allowing a very flexible user-defined config to define things like file paths. Docs: https://github.com/micromatch/anymatch
335
+
3.[`fs.utils.ignore`](https://www.npmjs.com/package/ignore) - To filter filenames according to a .gitignore file. https://www.npmjs.com/package/ignore
336
+
330
337
### Usage of encoding in `fs.readFile` API
331
338
332
339
```js
@@ -366,13 +373,20 @@ to use iconv to work with custom file encodings and then use the buffer.
366
373
```js
367
374
// to get a buffer from string, instead of doing Buffer.from, use iconv.encode
368
375
buf =Buffer.from("Sample input string", 'win1251'); // not supported/recommended and wont work even if it works for some cases
369
-
buf =fs.iconv.encode("Sample input string", 'win1251'); // recommended way to create buffer for encoding
376
+
buf =fs.utils.iconv.encode("Sample input string", 'win1251'); // recommended way to create buffer for encoding
370
377
371
378
// to convert buffer to string, use iconv as well
372
379
str =buf.toString('win1251'); // not supported/recommended and wont work even if it works for some cases
373
-
str =fs.iconv.decode(buf, 'win1251'); // recommended way
380
+
str =fs.utils.iconv.decode(buf, 'win1251'); // recommended way
374
381
```
375
382
383
+
## `EventEmitter`
384
+
This library provides a global utility, `EventEmitter`, which is accessible via `window.EventEmitter`,
385
+
`self.EventEmitter`, or simply `EventEmitter`, depending on the context. This utility replicates the
386
+
functionality of the Node.js event emitter API, offering a handy tool for incorporating familiar
387
+
Node.js-style event handling in your browser environment.
388
+
389
+
For a quick introduction on using the event emitter, refer to: [Node.js EventEmitter Guide](https://nodejs.dev/en/learn/the-nodejs-event-emitter/).
376
390
377
391
## `fs.mountNativeFolder(optionalDirHandle?, callback)` Function
0 commit comments