{"name":"watchpack","version":"1.7.5","description":"Wrapper library for directory and file watching.","main":"./lib/watchpack.js","directories":{"test":"test"},"scripts":{"pretest":"npm run lint","test":"mocha","travis":"npm run cover -- --report lcovonly","lint":"eslint lib","precover":"npm run lint","cover":"istanbul cover node_modules/mocha/bin/_mocha"},"repository":{"type":"git","url":"git+https://github.com/webpack/watchpack.git"},"author":{"name":"Tobias Koppers @sokra"},"license":"MIT","bugs":{"url":"https://github.com/webpack/watchpack/issues"},"homepage":"https://github.com/webpack/watchpack","devDependencies":{"codecov.io":"^0.1.6","coveralls":"^3.0.0","eslint":"^4.18.1","istanbul":"^0.4.3","mocha":"^5.0.1","rimraf":"^2.6.2","should":"^8.3.1"},"optionalDependencies":{"chokidar":"^3.4.1","watchpack-chokidar2":"^2.0.1"},"dependencies":{"graceful-fs":"^4.1.2","neo-async":"^2.5.0","chokidar":"^3.4.1","watchpack-chokidar2":"^2.0.1"},"readme":"# watchpack\n\nWrapper library for directory and file watching.\n\n[![Build Status](https://travis-ci.org/webpack/watchpack.svg?branch=master)](https://travis-ci.org/webpack/watchpack) [![Build status](https://ci.appveyor.com/api/projects/status/e5u2qvmugtv0r647/branch/master?svg=true)](https://ci.appveyor.com/project/sokra/watchpack/branch/master) [![Test coverage][coveralls-image]][coveralls-url]\n\n## Concept\n\nwatchpack high level API doesn't map directly to watchers. Instead a three level architecture ensures that for each directory only a single watcher exists.\n\n* The high level API requests `DirectoryWatchers` from a `WatcherManager`, which ensures that only a single `DirectoryWatcher` per directory is created.\n* A user-faced `Watcher` can be obtained from a `DirectoryWatcher` and provides a filtered view on the `DirectoryWatcher`.\n* Reference-counting is used on the `DirectoryWatcher` and `Watcher` to decide when to close them.\n* The real watchers (currently chokidar) are created by the `DirectoryWatcher`.\n* Files are never watched directly. This should keep the watcher count low.\n* Watching can be started in the past. This way watching can start after file reading.\n* Symlinks are not followed, instead the symlink is watched.\n\n## API\n\n``` javascript\nvar Watchpack = require(\"watchpack\");\n\nvar wp = new Watchpack({\n\t// options:\n\taggregateTimeout: 1000\n\t// fire \"aggregated\" event when after a change for 1000ms no additional change occurred\n\t// aggregated defaults to undefined, which doesn't fire an \"aggregated\" event\n\n\tpoll: true\n\t// poll: true - use polling with the default interval\n\t// poll: 10000 - use polling with an interval of 10s\n\t// poll defaults to undefined, which prefer native watching methods\n\t// Note: enable polling when watching on a network path\n\n\tignored: /node_modules/,\n\t// anymatch-compatible definition of files/paths to be ignored\n\t// see https://github.com/paulmillr/chokidar#path-filtering\n});\n\n// Watchpack.prototype.watch(string[] files, string[] directories, [number startTime])\nwp.watch(listOfFiles, listOfDirectories, Date.now() - 10000);\n// starts watching these files and directories\n// calling this again will override the files and directories\n\nwp.on(\"change\", function(filePath, mtime) {\n\t// filePath: the changed file\n\t// mtime: last modified time for the changed file\n});\n\nwp.on(\"aggregated\", function(changes) {\n\t// changes: an array of all changed files\n});\n\n// Watchpack.prototype.pause()\nwp.pause();\n// stops emitting events, but keeps watchers open\n// next \"watch\" call can reuse the watchers\n\n// Watchpack.prototype.close()\nwp.close();\n// stops emitting events and closes all watchers\n\n// Watchpack.prototype.getTimes()\nvar fileTimes = wp.getTimes();\n// returns an object with all know change times for files\n// this include timestamps from files not directly watched\n// key: absolute path, value: timestamp as number\n```\n\n[coveralls-url]: https://coveralls.io/r/webpack/watchpack/\n[coveralls-image]: https://img.shields.io/coveralls/webpack/watchpack.svg\n","readmeFilename":"README.md","gitHead":"a31d9eb0ac8a75d9dd68f687b3ed7e5ad84bae8c","_id":"watchpack@1.7.5","_nodeVersion":"15.1.0","_npmVersion":"7.0.8","dist":{"integrity":"sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==","shasum":"1267e6c55e0b9b5be44c2023aed5437a2c26c453","tarball":"http://registry-npm.ywwl.com/watchpack/download/watchpack-1.7.5.tgz","fileCount":7,"unpackedSize":22759,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqjDECRA9TVsSAnZWagAAVL4P+gKzpEfsHnjmpGsDqUF0\ni4TmoUVTWKNrrGFo0sD/F2VPvupP0NIA0V6LyCNFyq/szGq0QZ2nR2HxHV+d\nDKuUwXiYig1zoRPOYbwXnjvPGdRi991ZR0Byt3Ny9fIjXh9B05mP4ax3kruX\n7a9f6XhOucVbAJkPW6eIjZ0tg8DmfGyG7ilSuTX/FvOsmzgkswGYtJfXUXyz\ncq3vd4PORNtg10rn8Eqo6p/76Rdpz4G5FsMTvAGFFKYNz9FJ579/1prKNhMv\nxv58AGXu5rIS5Ef02qmiL7S0V+x7/i8MgxUlh57hF3NCLsViBMQ2tMbicQcM\nHcJuEiXygvLXI8MqhU7VEQ4/FAf/MhaJYRB+ZeVO/FupmmU4r+2ScSXnGa94\n+0CavY/dowMDwj/vmI/tw92Ja/8x3ekgpie4qgSWD3DHxljAR6iH7eBJtAui\niuASS3n2JFcMVv3pQINkA0oJbVCG+cEPMrsZdpbjV/gq08bCLpXYbuCCEDeg\nDekuFBjXFU6FbkINtuYdCk+4DF7etHYdUrCHaN/by21DL5B7ceB5Hkfs8ank\nUsAat+0bf8el2P9lRQcgRERJ6KUcHw5w65LZKLHRHJBLzATdw/gaiNrJ06FI\nXp5oSWdYVXZDetxtGUJJGZfYHf3pfENn73iAMEIlvzST30E+DHv47IoQMn1b\n6uz3\r\n=VkcB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMtb1ND5SQV6soTcK8HPu7hWhrBFtdfEP/ZjxMbnC4SAiAtGKJ4eYruRL+Y6pk0mbMZxhCogQGJxbnBYB40vtf5Bg=="}],"size":6195,"noattachment":false,"key":"/watchpack/-/watchpack-1.7.5.tgz"},"_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"maintainers":[{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/watchpack_1.7.5_1604989123599_0.4631524151017723"},"_hasShrinkwrap":false,"publish_time":1604989123743,"_cnpm_publish_time":1604989123743,"dist-tags":{"beta":"2.0.0-beta.15","latest":"2.6.3","watchpack-1":"1.7.5"}}