Ignore:
Timestamp:
01/21/25 03:08:24 (2 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
0c6b92a
Message:

F4 Finalna Verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/chokidar/README.md

    r0c6b92a r79a0317  
    113113
    114114  awaitWriteFinish: true, // emit single event when chunked writes are completed
    115   atomic: true // emit proper events when "atomic writes" (mv _tmp file) are used
     115  atomic: true, // emit proper events when "atomic writes" (mv _tmp file) are used
    116116
    117117  // The options also allow specifying custom intervals in ms
     
    121121  // },
    122122  // atomic: 100,
     123
    123124  interval: 100,
    124125  binaryInterval: 300,
     
    236237values are arrays of the names of the items contained in each directory.
    237238
    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
     241Check out third party [chokidar-cli](https://github.com/open-cli-tools/chokidar-cli),
     242which allows to execute a command on each change, or get a stdio stream of change events.
    243243
    244244## Troubleshooting
    245245
    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`
     246Sometimes, 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
     251There are two things that can cause it.
     252
     2531. 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`.
     2572. 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
     261All fsevents-related issues (`WARN optional dep failed`, `fsevents is not a constructor`) are solved by upgrading to v4+.
    254262
    255263## Changelog
     
    278286// other way
    279287import { glob } from 'node:fs/promises';
    280 const watcher = watch(await glob('**/*.js'));
     288const watcher = watch(await Array.fromAsync(glob('**/*.js')));
    281289
    282290// unwatching
Note: See TracChangeset for help on using the changeset viewer.