Skip to content

Commit 9f235bf

Browse files
committed
readme
1 parent bdd7b92 commit 9f235bf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ Sometimes, Chokidar runs out of file handles, causing `EMFILE` and `ENOSP` error
249249
* `Error: watch /home/ ENOSPC`
250250

251251
This can be solved by tuning OS params, or by using [graceful-fs](https://www.npmjs.com/package/graceful-fs),
252-
which can monkey-patch native `fs` module used by chokidar.
252+
which can monkey-patch native `fs` module used by chokidar:
253+
254+
```js
255+
const realFs = require('fs');
256+
const gracefulFs = require('graceful-fs');
257+
gracefulFs.gracefulify(realFs);
258+
```
259+
253260
To tune OS, execute `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
254261

255262
All fsevents-related issues (`WARN optional dep failed`, `fsevents is not a constructor`) are solved by upgrading to v4+.

0 commit comments

Comments
 (0)