{"_id":"inotify-plusplus","_rev":"19-457af2206b2919667a7dfa731651e4a6","name":"inotify-plusplus","description":"A wrapper around node-inotify that is more like JavaScript, less like C, and easier for beginners","dist-tags":{"latest":"1.0.2"},"versions":{"0.9.0":{"name":"inotify-plusplus","description":"A wrapper around node-inotify that is more like JavaScript, less like C, and easier for beginners","url":"http://github.com/coolaj86/node-inotify-plusplus/","keywords":["util","inotify"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com"},"contributors":[],"dependencies":{"inotify":""},"lib":"lib","main":"./lib/inotify++","version":"0.9.0","_id":"inotify-plusplus@0.9.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"https://registry.npmjs.org/inotify-plusplus/-/inotify-plusplus-0.9.0.tgz","shasum":"3fb55251e5e12dd8de31ff43a50f8854cac3a133","integrity":"sha512-B79ukrcWM3KFo/5tGV0FmPeavHVBLkjHJoa33g/WqQtYS6Dxr+bnmran6tpxllNN/+7Rs6dADDOCjpuxcdxqgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH1qwisxi0PlJO60jyXdDdR469h1RbuIC/3ylo9nUzd4CIQCQgjDOmDRnXDibbt3TKBxT8ns/yTgUNMxmNvZwhfZdow=="}]},"directories":{}},"1.0.0":{"name":"inotify-plusplus","description":"A wrapper around node-inotify that is more like JavaScript, less like C, and easier for beginners","url":"http://github.com/coolaj86/node-inotify-plusplus/","keywords":["util","inotify"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com"},"contributors":[],"dependencies":{"inotify":""},"lib":"lib","main":"./lib/inotify++","version":"1.0.0","_id":"inotify-plusplus@1.0.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"https://registry.npmjs.org/inotify-plusplus/-/inotify-plusplus-1.0.0.tgz","shasum":"8c61eef73eba782e0712309d7955e149ea12f485","integrity":"sha512-zLnwOd4CGmP3Wsm6bMkzYlwuN+0XLGUKxuiJG80SR2Cf0SwSB096Cp87jldStibQKGeKDX8NGUSQoQVNbGbWEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8QqsziWnGaK44JpDw/2Bh0Ooj6OIWNYdRA1JOrCJZZAiEAnn+P6mok/QR9roWpRpCtmy+HEpA5L4c5WA+OWGPWUw8="}]},"directories":{}},"1.0.1":{"name":"inotify-plusplus","description":"A wrapper around node-inotify that is more like JavaScript, less like C, and easier for beginners","url":"http://github.com/coolaj86/node-inotify-plusplus/","keywords":["util","inotify"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com"},"contributors":[],"dependencies":{"inotify":""},"lib":"lib","main":"./lib/inotify++","version":"1.0.1","readme":"node-inotify++\n====\n\nA wrapper around [`node-inotify`](http://github.com/c4milo/node-inotify) which is more like `JavaScript` and less like `C`.\n\n  * strings instead of bitmasks\n  * self-documenting: `console.dir(inotify)` tells you just about all you need to know.\n  * each event has a default handler\n  * by default only the events which have callbacks are listened to\n    * `all_events` listens to all events with registered callbacks\n    * the option `all_events_is_catchall` causes `all_events` to listen on all events, period.\n\nUsage\n====\n\ninstantiation\n----\n\n    var Inotify = require('inotify-plusplus'), // should be 'inotify++', but npm has issues with the ++\n        inotify,\n        directive,\n        options;\n\n    inotify = Inotify.create(true); // stand-alone, persistent mode, runs until you hit ctrl+c\n    //inotify = Inotify.create(); // quits when event queue is empty\n\nwith Default Handlers\n----\n\nThe default handler simply outputs the `docstring` such as \"File was opened\"\n\n    directive = {\n        access: true,\n        close_write: true,\n        open: true\n    };\n    options = {\n        allow_bad_paths: true, // (default false) don't throw an error if the path to watch doesn't exist\n    };\n    inotify.watch(directive, './path/to/watch', {});\n\nwith Custom Handlers\n----\n\n    directive = {\n        all_events: function (ev) {\n          console.log(\"some things happened: \" + ev.masks.toString())\n        },\n        moved_from: true\n    }\n    options = {\n        all_events_is_catchall: true // by default (false) \"all_events\" only catches events already listened for.\n                                     // this option tells \"all_events\" to catch all events, period.\n    }\n    inotify.watch(directive, './path/to/watch');\n\nnote that \"ev.masks\" is an array of strings, not a bitmask and \"ev.watch\" is the path rather than the watch descriptor.\n\nExample `ev`:\n\n    { watch: '/path/to/watch', masks: '[\"access\", \"move_to\"]', cookie: 1, name: 'name_of_file' }\n\nwith Modules\n----\n\n    directive = (function() {\n        // private variables\n        var count = 0,\n          validate_watch,\n          move,\n          cookies = {};\n\n        // shared method\n        move = function (ev) {\n            var pre = cookies[ev.cookie];\n            if (pre) {\n              console.log(\"finished move from \" + pre.name + \" to \" + ev.name);\n              cookies[ev.cookie] = undefined;\n              delete cookies[ev.cookie];\n            } else {\n              // expires the cookie if the move doesn't complete in this watch\n              console.log(\"began move of \" + ev.name);\n              cookies[ev.cookie] = ev;\n              setTimeout(function () {\n                cookies[ev.cookie] = undefined;\n                delete cookies[ev.cookie];\n              }, 500);\n            }\n        };\n\n        // will listen to three events\n        // multiple events may fire at the same time\n        return {\n          all_events: function(ev) {\n            // example ev: { watch: '/path/to/watch', masks: '[\"access\", \"move_to\"]', cookie: 1, name: 'name_of_file' }\n            validate_watch();\n            count += 1;\n            console.log(\"These masks were just activated: '\" + ev.masks.toString() + \"' for '\" + ev.name + \"'.\");\n          },\n          access: function (ev) {\n            console.log(ev.name + \" was accessed.\");\n          },\n          moved_to: move,\n          moved_from: move,\n          delete: true\n        };\n    }());\n    inotify.watch(directive, './path/to/watch');\n\nstopping / restarting watch\n----\n\n    var unwatch, rewatch;\n    unwatch = inotify.watch(dirctive, path);\n    rewatch = unwatch(); // stops watching\n    unwach = rewatch();\n\nInstallation\n====\n\nInstall node-inotify:\n\n    cd ~/\n    git clone git://github.com/c4milo/node-inotify.git\n    cd node-inotify\n    node-waf configure build\n\n    # or\n\n    npm install inotify\n\nInstall node-inotify++:\n\n    mkdir ~/.node_libraries/\n    wget http://github.com/coolaj86/node-inotify-plusplus/blob/master/lib/inotify%2B%2B.js -O \\\n      ~/.node_libraries/inotify++.js\n\n    # or\n\n    npm install inotify-plusplus # installing inotify from npm currently fails and hence this may fail\n\nDocumentation\n====\n\n`console.dir(Inotify.watch_for_doc);`\n    {\n        access: \"File was accessed (read)\",\n        attrib: \"Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc.\",\n        close_write: \"File opened for writing was closed\",\n        close_nowrite: \"File not opened for writing was closed\",\n        create: \"File/directory created Inotify the watched directory\",\n        \"delete\": \"File/directory deleted from the watched directory\",\n        delete_self: \"Watched file/directory was deleted\",\n        modify: \"File was modified\",\n        move_self: \"Watched file/directory was moved\",\n        moved_from: \"File moved out of the watched directory\",\n        moved_to: \"File moved into watched directory\",\n        open: \"File was opened\",\n        all_events: \"Watch for all kind of events\",\n        close: \"(IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) Close\",\n        move: \"(IN_MOVED_FROM | IN_MOVED_TO) Moves\"\n    }\n\n`console.dir(Inotify.info_doc);`\n    {\n        in_ignored: \"Watch was removed explicitly with inotify.removeWatch(watch_descriptor) or automatically (the file was deleted, or the file system was unmounted)\",\n        in_isdir: \"Subject of this event is a directory\",\n        in_q_overflow: \"Event queue overflowed (wd is -1 for this event)\",\n        in_unmount: \"File system containing the watched object was unmounted\"\n    }\n\n`console.dir(Inotify.flags_doc);`\n    {\n      onlydir: \"only watch the path if it is a directory.\",\n      dont_follow: \"do not follow symbolics links\",\n      oneshot: \"only send events once\",\n      mask_add: \"add (or) events to watch mask for this pathname if it already exists (instead of replacing the mask).\"\n    }\n","_id":"inotify-plusplus@1.0.1","dist":{"shasum":"3182c6bb7afb9a0e8ac83fb16642aea993166845","tarball":"https://registry.npmjs.org/inotify-plusplus/-/inotify-plusplus-1.0.1.tgz","integrity":"sha512-ZvF8eOf9eXWQ6sgX+lMFd/lPl0PNZMVJ6v6Kq+mzahxfrYDe9aId/dvKlcw7Etdt6mztqGUKQ5vW+b6NuibM9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmZyjKTucMfU7poCMC27KpNdq7FbGo9ITYx3CD271o0AiEA8L07e3Rbs3iN/fbfFVl7faY0eTqaqbfGwaH5no2JKc0="}]},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}]},"1.0.2":{"name":"inotify-plusplus","description":"A wrapper around node-inotify that is more like JavaScript, less like C, and easier for beginners","url":"http://github.com/coolaj86/node-inotify-plusplus/","keywords":["util","inotify"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com"},"contributors":[],"dependencies":{"inotify":"~1.2.0"},"lib":"lib","main":"./lib/inotify++","version":"1.0.2","readme":"node-inotify++\n====\n\nA wrapper around [`node-inotify`](http://github.com/c4milo/node-inotify) which is more like `JavaScript` and less like `C`.\n\n  * strings instead of bitmasks\n  * self-documenting: `console.dir(inotify)` tells you just about all you need to know.\n  * each event has a default handler\n  * by default only the events which have callbacks are listened to\n    * `all_events` listens to all events with registered callbacks\n    * the option `all_events_is_catchall` causes `all_events` to listen on all events, period.\n\nUsage\n====\n\ninstantiation\n----\n\n    var Inotify = require('inotify-plusplus'), // should be 'inotify++', but npm has issues with the ++\n        inotify,\n        directive,\n        options;\n\n    inotify = Inotify.create(true); // stand-alone, persistent mode, runs until you hit ctrl+c\n    //inotify = Inotify.create(); // quits when event queue is empty\n\nwith Default Handlers\n----\n\nThe default handler simply outputs the `docstring` such as \"File was opened\"\n\n    directive = {\n        access: true,\n        close_write: true,\n        open: true\n    };\n    options = {\n        allow_bad_paths: true, // (default false) don't throw an error if the path to watch doesn't exist\n    };\n    inotify.watch(directive, './path/to/watch', {});\n\nwith Custom Handlers\n----\n\n    directive = {\n        all_events: function (ev) {\n          console.log(\"some things happened: \" + ev.masks.toString())\n        },\n        moved_from: true\n    }\n    options = {\n        all_events_is_catchall: true // by default (false) \"all_events\" only catches events already listened for.\n                                     // this option tells \"all_events\" to catch all events, period.\n    }\n    inotify.watch(directive, './path/to/watch');\n\nnote that \"ev.masks\" is an array of strings, not a bitmask and \"ev.watch\" is the path rather than the watch descriptor.\n\nExample `ev`:\n\n    { watch: '/path/to/watch', masks: '[\"access\", \"move_to\"]', cookie: 1, name: 'name_of_file' }\n\nwith Modules\n----\n\n    directive = (function() {\n        // private variables\n        var count = 0,\n          validate_watch,\n          move,\n          cookies = {};\n\n        // shared method\n        move = function (ev) {\n            var pre = cookies[ev.cookie];\n            if (pre) {\n              console.log(\"finished move from \" + pre.name + \" to \" + ev.name);\n              cookies[ev.cookie] = undefined;\n              delete cookies[ev.cookie];\n            } else {\n              // expires the cookie if the move doesn't complete in this watch\n              console.log(\"began move of \" + ev.name);\n              cookies[ev.cookie] = ev;\n              setTimeout(function () {\n                cookies[ev.cookie] = undefined;\n                delete cookies[ev.cookie];\n              }, 500);\n            }\n        };\n\n        // will listen to three events\n        // multiple events may fire at the same time\n        return {\n          all_events: function(ev) {\n            // example ev: { watch: '/path/to/watch', masks: '[\"access\", \"move_to\"]', cookie: 1, name: 'name_of_file' }\n            validate_watch();\n            count += 1;\n            console.log(\"These masks were just activated: '\" + ev.masks.toString() + \"' for '\" + ev.name + \"'.\");\n          },\n          access: function (ev) {\n            console.log(ev.name + \" was accessed.\");\n          },\n          moved_to: move,\n          moved_from: move,\n          delete: true\n        };\n    }());\n    inotify.watch(directive, './path/to/watch');\n\nstopping / restarting watch\n----\n\n    var unwatch, rewatch;\n    unwatch = inotify.watch(dirctive, path);\n    rewatch = unwatch(); // stops watching\n    unwach = rewatch();\n\nInstallation\n====\n\nInstall node-inotify:\n\n    cd ~/\n    git clone git://github.com/c4milo/node-inotify.git\n    cd node-inotify\n    node-waf configure build\n\n    # or\n\n    npm install inotify\n\nInstall node-inotify++:\n\n    mkdir ~/.node_libraries/\n    wget http://github.com/coolaj86/node-inotify-plusplus/blob/master/lib/inotify%2B%2B.js -O \\\n      ~/.node_libraries/inotify++.js\n\n    # or\n\n    npm install inotify-plusplus # installing inotify from npm currently fails and hence this may fail\n\nDocumentation\n====\n\n`console.dir(Inotify.watch_for_doc);`\n    {\n        access: \"File was accessed (read)\",\n        attrib: \"Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc.\",\n        close_write: \"File opened for writing was closed\",\n        close_nowrite: \"File not opened for writing was closed\",\n        create: \"File/directory created Inotify the watched directory\",\n        \"delete\": \"File/directory deleted from the watched directory\",\n        delete_self: \"Watched file/directory was deleted\",\n        modify: \"File was modified\",\n        move_self: \"Watched file/directory was moved\",\n        moved_from: \"File moved out of the watched directory\",\n        moved_to: \"File moved into watched directory\",\n        open: \"File was opened\",\n        all_events: \"Watch for all kind of events\",\n        close: \"(IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) Close\",\n        move: \"(IN_MOVED_FROM | IN_MOVED_TO) Moves\"\n    }\n\n`console.dir(Inotify.info_doc);`\n    {\n        in_ignored: \"Watch was removed explicitly with inotify.removeWatch(watch_descriptor) or automatically (the file was deleted, or the file system was unmounted)\",\n        in_isdir: \"Subject of this event is a directory\",\n        in_q_overflow: \"Event queue overflowed (wd is -1 for this event)\",\n        in_unmount: \"File system containing the watched object was unmounted\"\n    }\n\n`console.dir(Inotify.flags_doc);`\n    {\n      onlydir: \"only watch the path if it is a directory.\",\n      dont_follow: \"do not follow symbolics links\",\n      oneshot: \"only send events once\",\n      mask_add: \"add (or) events to watch mask for this pathname if it already exists (instead of replacing the mask).\"\n    }\n","readmeFilename":"README.md","_id":"inotify-plusplus@1.0.2","dist":{"shasum":"919e0d00c7a1e6265f0d4894c42507349109776d","tarball":"https://registry.npmjs.org/inotify-plusplus/-/inotify-plusplus-1.0.2.tgz","integrity":"sha512-Ic89DCOu02W7rwpoh+iUKM5jNGm9swyHfYtLvKBhB1k3dIIoMZfjMU05XkIuBNAaWP1FWKJ+n2M54BF3EADw5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkThSHa33P8Ayljay0xtnEKDwDHmkihTA28KbmurTi2AiEAinTZ2V10OPA8fmqET1wXN87J2A6UYkiOtZk7fYrcefc="}]},"_from":"./","_npmVersion":"1.2.12","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}]}},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com"},"time":{"modified":"2022-06-19T01:25:03.576Z","created":"2011-08-26T18:39:17.780Z","0.9.0":"2011-08-26T18:39:17.780Z","1.0.0":"2011-08-26T18:39:17.780Z","1.0.1":"2012-09-10T23:18:06.900Z","1.0.2":"2013-03-09T22:20:56.116Z"}}