{"name":"watchpack","version":"2.0.0-beta.9","description":"Wrapper library for directory and file watching.","main":"./lib/watchpack.js","directories":{"test":"test"},"scripts":{"pretest":"yarn lint","test":"mocha","lint":"eslint lib","precover":"yarn lint","pretty-files":"prettier \"lib/**.*\" \"test/**/*.js\" --write","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":{"coveralls":"^3.0.0","eslint":"^5.11.1","eslint-config-prettier":"^4.3.0","eslint-plugin-prettier":"^3.1.0","istanbul":"^0.4.3","mocha":"^5.0.1","prettier":"^1.11.0","rimraf":"^2.6.2","should":"^8.3.1"},"dependencies":{"glob-to-regexp":"^0.4.1","graceful-fs":"^4.1.2","neo-async":"^2.5.0"},"engines":{"node":">=10.13.0"},"readme":"# watchpack\n\nWrapper library for directory and file watching.\n\n[![Build Status][build-status]][build-status-url]\n[![Build status][build-status-veyor]][build-status-veyor-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![codecov][codecov]][codecov-url]\n[![downloads][downloads]][downloads-url]\n[![Github contributors][contributors]][contributors-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 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\t// When WATCHPACK_POLLING environment variable is set it will override this option\n\n\tfollowSymlinks: true,\n\t// true: follows symlinks and watches symlinks and real files\n\t//   (This makes sense when symlinks has not been resolved yet, comes with a performance hit)\n\t// false (default): watches only specified item they may be real files or symlinks\n\t//   (This makes sense when symlinks has already been resolved)\n\n\tignored: \"**/.git\"\n\t// ignored: \"string\" - a glob pattern for files or folders that should not be watched\n\t// ignored: [\"string\", \"string\"] - multiple glob patterns that should be ignored\n\t// All subdirectories are ignored too\n});\n\n// Watchpack.prototype.watch(files: Iterable<string>, directories: Iterable<string>, startTime?: number)\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 (null if file was removed)\n\t// for folders it's a time before that all changes in the directory happened\n});\n\nwp.on(\"aggregated\", function(changes, removals) {\n\t// changes: a Set of all changed files\n\t// removals: a Set of all removed files\n\t// watchpack gives up ownership on these Sets.\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.getTimeInfoEntries()\nvar fileTimes = wp.getTimeInfoEntries();\n// returns a Map with all known time info objects for files and directories\n// this include info from files not directly watched\n// key: absolute path, value: object with { safeTime, timestamp }\n// safeTime: a point in time at which it is safe to say all changes happened before that\n// timestamp: only for files, the mtime timestamp of the file\n\n// (deprecated)\n// Watchpack.prototype.getTimes()\nvar fileTimes = wp.getTimes();\n// returns an object with all known change times for files\n// this include timestamps from files not directly watched\n// key: absolute path, value: timestamp as number\n```\n\n[build-status]: https://travis-ci.org/webpack/watchpack.svg?branch=master\n[build-status-url]: https://travis-ci.org/webpack/watchpack\n[build-status-veyor]: https://ci.appveyor.com/api/projects/status/e5u2qvmugtv0r647/branch/master?svg=true\n[build-status-veyor-url]: https://ci.appveyor.com/project/sokra/watchpack/branch/master\n[coveralls-url]: https://coveralls.io/r/webpack/watchpack/\n[coveralls-image]: https://img.shields.io/coveralls/webpack/watchpack.svg\n[codecov]: https://codecov.io/gh/webpack/watchpack/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/webpack/watchpack\n[downloads]: https://img.shields.io/npm/dm/watchpack.svg\n[downloads-url]: https://www.npmjs.com/package/watchpack\n[contributors]: https://img.shields.io/github/contributors/webpack/watchpack.svg\n[contributors-url]: https://github.com/webpack/watchpack/graphs/contributors\n","readmeFilename":"README.md","gitHead":"4b97ddd449cfa7b28f506a3fbbfd1bb5f7887ba9","_id":"watchpack@2.0.0-beta.9","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-tk6i7Mh7zt4Z6c7Pa7PBMRPM04es+1KB2JITgR0O/SZLKnCbT05u/B53WJp+FcPZLes3HQZ1d27fYy6FRFYb5Q==","shasum":"c9a2d25af677203c5a0727803d72239d8f60499d","tarball":"http://registry-npm.ywwl.com/watchpack/download/watchpack-2.0.0-beta.9.tgz","fileCount":7,"unpackedSize":35782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdt9V3CRA9TVsSAnZWagAAdscP/1eHFWP3OX4KHt1nHe5p\nBn8bQ2Q8BQlQi+FmkrDhbDO6lD1sAF4U22tX8SwnmEn3cX6yXFtABToOWh29\n0MPLms4jCtdkNKMLeqNP8upWRKOTyHcn8aH9b0gF5237yOKWSUjpkNCYBvAI\nCk1MDHmIz08pqrlgsiFaHSXVGsPGxlTbksXUm4wiwGD9/QGbMw4p0EhUU991\n+qkpFM+50rwXBIMytKPCCXL8o14GHb8nuTs3fKZa4mbz1ib8/4VpwQaRSIIH\nPrBmAQrHdSi6zrRbV4nVpi2jPnxhu6mKh+1G/gRspqTfjNW/7vWZUJ0ZblDK\naTmB1CNFRU/hhvnpUBh1pYTCwiFTcsDw0McHfyK5qWchm1oMPSGn2D/X5JY3\nz04p0d/w5vFjGncv88oy01hyDR841e8enjkLEipiRPRTNTZsl5XBDS9MiLyw\ns/ZP0uwm6H4qsp1tfdDuaqdXospT0RF2YQqL7lbdzmj+Rd9BtcmTR37XhKlC\nb34kOVuU4pZRsGLUNsOH7He8fg5dfsSWKW4lgllwTM4NFO3W1qVlvubxNG/R\n29M+QEQRNwzqE0rGBxDQZcBxWx0mazCbn4NAQ+13WXBNzr2dQZLZ+SBMB8xY\niGcIGkwj1ScRwKZDFCciskuRFG627MalMEeCSx6WYyMPaCpaRREzqEu2stfR\n6mUK\r\n=+LvO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPY8oLOIefayNDqQxDl9mouXA9TVr+NTRSYklj9XQMSQIhAIVgotK2rCBuT+T94nDLgYVHB6d6NQb4ionPYq+sW+0a"}],"size":9557,"noattachment":false,"key":"/watchpack/-/watchpack-2.0.0-beta.9.tgz"},"maintainers":[{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/watchpack_2.0.0-beta.9_1572328823168_0.9144453552428942"},"_hasShrinkwrap":false,"publish_time":1572328823265,"_cnpm_publish_time":1572328823265,"dist-tags":{"beta":"2.0.0-beta.15","latest":"2.6.3","watchpack-1":"1.7.5"}}