Changeset 79a0317 for imaps-frontend/node_modules/chokidar/README.md
- Timestamp:
- 01/21/25 03:08:24 (2 weeks ago)
- Branches:
- main
- Parents:
- 0c6b92a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/chokidar/README.md
r0c6b92a r79a0317 113 113 114 114 awaitWriteFinish: true, // emit single event when chunked writes are completed 115 atomic: true // emit proper events when "atomic writes" (mv _tmp file) are used115 atomic: true, // emit proper events when "atomic writes" (mv _tmp file) are used 116 116 117 117 // The options also allow specifying custom intervals in ms … … 121 121 // }, 122 122 // atomic: 100, 123 123 124 interval: 100, 124 125 binaryInterval: 300, … … 236 237 values are arrays of the names of the items contained in each directory. 237 238 238 ## CLI 239 240 If you need a CLI interface for your file watching, check out 241 third party [chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), allowing you to 242 execute a command on each change, or get a stdio stream of change events. 239 ### CLI 240 241 Check out third party [chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), 242 which allows to execute a command on each change, or get a stdio stream of change events. 243 243 244 244 ## Troubleshooting 245 245 246 * On Linux, sometimes there's `ENOSP` error: 247 * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell` 248 `Error: watch /home/ ENOSPC` 249 * This means Chokidar ran out of file handles and you'll need to increase their count by executing the following command in Terminal: 250 `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p` 251 * If using 3.x, upgrade to latest chokidar to prevent fsevents-related issues: 252 * `npm WARN optional dep failed, continuing fsevents@n.n.n` 253 * `TypeError: fsevents is not a constructor` 246 Sometimes, Chokidar runs out of file handles, causing `EMFILE` and `ENOSP` errors: 247 248 * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell` 249 * `Error: watch /home/ ENOSPC` 250 251 There are two things that can cause it. 252 253 1. Exhausted file handles for generic fs operations 254 - Can be solved by using [graceful-fs](https://www.npmjs.com/package/graceful-fs), 255 which can monkey-patch native `fs` module used by chokidar: `let fs = require('fs'); let grfs = require('graceful-fs'); grfs.gracefulify(fs);` 256 - Can also be solved by tuning OS: `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`. 257 2. Exhausted file handles for `fs.watch` 258 - Can't seem to be solved by graceful-fs or OS tuning 259 - It's possible to start using `usePolling: true`, which will switch backend to resource-intensive `fs.watchFile` 260 261 All fsevents-related issues (`WARN optional dep failed`, `fsevents is not a constructor`) are solved by upgrading to v4+. 254 262 255 263 ## Changelog … … 278 286 // other way 279 287 import { glob } from 'node:fs/promises'; 280 const watcher = watch(await glob('**/*.js'));288 const watcher = watch(await Array.fromAsync(glob('**/*.js'))); 281 289 282 290 // unwatching
Note:
See TracChangeset
for help on using the changeset viewer.