105 lines
7.0 KiB
JSON
105 lines
7.0 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "watch@~0.18.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "watch",
|
||
|
"name": "watch",
|
||
|
"rawSpec": "~0.18.0",
|
||
|
"spec": ">=0.18.0 <0.19.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/sane"
|
||
|
]
|
||
|
],
|
||
|
"_from": "watch@>=0.18.0 <0.19.0",
|
||
|
"_id": "watch@0.18.0",
|
||
|
"_inCache": true,
|
||
|
"_location": "/watch",
|
||
|
"_nodeVersion": "4.4.2",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "packages-12-west.internal.npmjs.com",
|
||
|
"tmp": "tmp/watch-0.18.0.tgz_1461962739879_0.18643369735218585"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "mikeal",
|
||
|
"email": "mikeal.rogers@gmail.com"
|
||
|
},
|
||
|
"_npmVersion": "2.15.0",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "watch@~0.18.0",
|
||
|
"scope": null,
|
||
|
"escapedName": "watch",
|
||
|
"name": "watch",
|
||
|
"rawSpec": "~0.18.0",
|
||
|
"spec": ">=0.18.0 <0.19.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/sane"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz",
|
||
|
"_shasum": "28095476c6df7c90c963138990c0a5423eb4b986",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "watch@~0.18.0",
|
||
|
"_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/sane",
|
||
|
"author": {
|
||
|
"name": "Mikeal Rogers",
|
||
|
"email": "mikeal.rogers@gmail.com"
|
||
|
},
|
||
|
"bin": {
|
||
|
"watch": "./cli.js"
|
||
|
},
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/mikeal/watch/issues"
|
||
|
},
|
||
|
"dependencies": {
|
||
|
"exec-sh": "^0.2.0",
|
||
|
"minimist": "^1.2.0"
|
||
|
},
|
||
|
"description": "Utilities for watching file trees.",
|
||
|
"devDependencies": {},
|
||
|
"directories": {
|
||
|
"lib": "lib"
|
||
|
},
|
||
|
"dist": {
|
||
|
"shasum": "28095476c6df7c90c963138990c0a5423eb4b986",
|
||
|
"tarball": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">=0.1.95"
|
||
|
},
|
||
|
"gitHead": "9529f78fc6912acf4ed39cf384dec0ec79c624a9",
|
||
|
"homepage": "https://github.com/mikeal/watch",
|
||
|
"keywords": [
|
||
|
"util",
|
||
|
"utility",
|
||
|
"fs",
|
||
|
"files"
|
||
|
],
|
||
|
"license": "Apache-2.0",
|
||
|
"main": "./main",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "mikeal",
|
||
|
"email": "mikeal.rogers@gmail.com"
|
||
|
},
|
||
|
{
|
||
|
"name": "finnpauls",
|
||
|
"email": "derfinn@gmail.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "watch",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# watch -- Utilities for watching file trees in node.js\n\n## Install\n\n<pre>\n npm install watch\n</pre>\n\n## Purpose\n\nThe intention of this module is provide tools that make managing the watching of file & directory trees easier.\n\n#### watch.watchTree(root, [options,] callback)\n\nThe first argument is the directory root you want to watch.\n\nThe options object is passed to fs.watchFile but can also be used to provide two additional watchTree specific options:\n\n* `'ignoreDotFiles'` - When true this option means that when the file tree is walked it will ignore files that being with \".\"\n* `'filter'` - You can use this option to provide a function that returns true or false for each file and directory to decide whether or not that file/directory is included in the watcher.\n* `'interval' - Specifies the interval duration in milliseconds, the time period between polling for file changes.\n* `'ignoreUnreadableDir'` - When true, this options means that when a file can't be read, this file is silently skipped.\n* `'ignoreNotPermitted'` - When true, this options means that when a file can't be read due to permission issues, this file is silently skipped.\n* `'ignoreDirectoryPattern'` - When a regex pattern is set, e.g. /node_modules/, these directories are silently skipped.\n\nThe callback takes 3 arguments. The first is the file that was modified. The second is the current stat object for that file and the third is the previous stat object.\n\nWhen a file is new the previous stat object is null.\n\nWhen watchTree is finished walking the tree and adding all the listeners it passes the file hash (keys are the file/directory names and the values are the current stat objects) as the first argument and null as both the previous and current stat object arguments.\n\n<pre>\n watch.watchTree('/home/mikeal', function (f, curr, prev) {\n if (typeof f == \"object\" && prev === null && curr === null) {\n // Finished walking the tree\n } else if (prev === null) {\n // f is a new file\n } else if (curr.nlink === 0) {\n // f was removed\n } else {\n // f was changed\n }\n })\n</pre>\n\n### watch.unwatchTree(root)\n\nUnwatch a previously watched directory root using `watch.watchTree`.\n\n### watch.createMonitor(root, [options,] callback)\n\nThis function creates an EventEmitter that gives notifications for different changes that happen to the file and directory tree under the given root argument.\n\nThe options object is passed to watch.watchTree.\n\nThe callback receives the monitor object.\n\nThe monitor object contains a property, `files`, which is a hash of files and directories as keys with the current stat object as the value.\n\nThe monitor has the following events.\n\n* `'created'` - New file has been created. Two arguments, the filename and the stat object.\n* `'removed'` - A file has been moved or deleted. Two arguments, the filename and the stat object for the fd.\n* `'changed'` - A file has been changed. Three arguments, the filename, the current stat object, and the previous stat object.\n\nThe monitor can be stopped using `.stop` (calls `unwatchTree`).\n\n<pre>\n var watch = require('watch')\n watch.createMonitor('/home/mikeal', function (monitor) {\n monitor.files['/home/mikeal/.zshrc'] // Stat object for my zshrc.\n monitor.on(\"created\", function (f, stat) {\n // Handle new files\n })\n monitor.on(\"changed\", function (f, curr, prev) {\n // Handle file changes\n })\n monitor.on(\"removed\", function (f, stat) {\n // Handle removed files\n })\n monitor.stop(); // Stop watching\n })\n</pre>\n\n### CLI\n\nThis module includes a simple command line interface, which you can install with `npm install watch -g`.\n\n\n```\nUsage: watch <command> [...directory] [OPTIONS]\n\nOPTIONS:\n --wait=<seconds>\n Duration, in seconds, that watching will be disabled\n after running <command>. Setting this option will\n throttle calls to <command> for the specified duration.\n\n --filter=<file>\n Path to a
|
||
|
"readmeFilename": "readme.mkd",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git://github.com/mikeal/watch.git"
|
||
|
},
|
||
|
"scripts": {},
|
||
|
"version": "0.18.0"
|
||
|
}
|