{"name":"watchpack","version":"2.0.0-beta.0","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","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","istanbul":"^0.4.3","mocha":"^5.0.1","rimraf":"^2.6.2","should":"^8.3.1"},"dependencies":{"graceful-fs":"^4.1.2","neo-async":"^2.5.0"},"engines":{"node":">=6.11.5"},"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] [![codecov](https://codecov.io/gh/webpack/watchpack/branch/master/graph/badge.svg)](https://codecov.io/gh/webpack/watchpack)\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\n// Watchpack.prototype.watch(files: string[], directories: 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});\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: the time before that all changes happened\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[coveralls-url]: https://coveralls.io/r/webpack/watchpack/\n[coveralls-image]: https://img.shields.io/coveralls/webpack/watchpack.svg\n","readmeFilename":"README.md","gitHead":"80ffc552b6c13468189bb669013d987b58ef3bb8","_id":"watchpack@2.0.0-beta.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-h3YpcnXN26weHY4YpP1TExb8jrZA4EP8KIZpGpW4KynMSrubNNDfatFAJV1XMOdt5v47afvgfW7QHJ9cks68lA==","shasum":"b94d7639340a966029940d07648e72de1ee435a9","tarball":"http://registry-npm.ywwl.com/watchpack/download/watchpack-2.0.0-beta.0.tgz","fileCount":6,"unpackedSize":27499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNKA2CRA9TVsSAnZWagAAK7YP/3UJ26/lJ4hiF4zkx7mZ\nlZx/ZuCnjbLbsjiBQd77SuQMOHSRndsXuD3dtQUss+L4isQsm+MK7aV0w3xQ\nkrXbNa4svhLxvmG6RLD0HFz9arZDs5KX8WVZ1cbNRiL4N8AY7gGb+DChxhE/\n9TiNDJE8n3CbSqVBJ5e6GXvt5k2Pg54BQnvCyyXbqWmAsAhsd2rNGERr+ULI\nQB+dZcBS5u45QuZK0b47WVrgompsBKW1QvjOD0SBzlHdHKc2UhLPbrMWWpHY\n3o1ih6VXT91mFejJC1bbEzjyuaHmPCy3lkmyJ41XSbIhoEHd0mEbY2rYc/Vs\nx5kZEc8qku0CS6z7PIDFd+hdj4iaj3vjIzEIK9Fr9ldtaCxNKHcElGq0i80d\nsT14JkymYo0q0nnyr2vvTHXOytMXwgxsKFjNXIrp10p9X1gS9vO79JNqK2KF\nkgYLRBWH0O/wEuElgS6WIH+B68K8ZX5Kis2C6UdmE8S/BdYX6ISvfXjwQUy8\n9X4L7r/05u8ctT0oudbSOTiEitbelt1rOBdXvAeTwUg9odbbzzNl88pCzjNe\n2dg0LRakI73lXHmev7zydnhnQAZG1RANiAYsp57H47lZgcC6sQ5pb0l4mxcs\ntP5K+OOMB9ecNgD2S7TeWCg71ugmtYSl4UqnZoXVT2sR7FEhaO/WoQZ6mr0v\n1qRW\r\n=gV6J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJQHQ3PmaP3PDv5Zry8HMVkHy7MW4blliHJD5Nw2/xvQIgbCj8mtEdNPyeXWl3teqr4RbKUn2P/0W58xNMjWA0h0g="}],"size":7375,"noattachment":false,"key":"/watchpack/-/watchpack-2.0.0-beta.0.tgz"},"maintainers":[{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/watchpack_2.0.0-beta.0_1546952757672_0.7579133625929286"},"_hasShrinkwrap":false,"publish_time":1546952757868,"_cnpm_publish_time":1546952757868,"dist-tags":{"beta":"2.0.0-beta.15","latest":"2.6.3","watchpack-1":"1.7.5"}}