{"_id":"monocle","_rev":"44-d392c0288d80b2a4708df64f15a8ab97","name":"monocle","description":"a tool for watching directories for file changes","dist-tags":{"latest":"1.1.51"},"versions":{"0.1.0":{"name":"monocle","version":"0.1.0","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3","underscore":"~1.4.4"},"devDependencies":{},"scripts":{"test":"mocha test"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"**Monocle -- a tool for watching things**\n\n`npm install monocle`\n\n`var Monocle = require('monocle')\n (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);\n`\n\n\n## Filters\n\nThere are three different ways to specify filters for files and directories respectively.\n\n- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry\n\n- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more\n    information.\n\n    Globstars (`**`) are not supported since specifiying a recursive pattern for an already recursive function doesn't make sense.\n\n    Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files.\n\n- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown.\n\n    `[ '*.json', '*.js' ]` includes all JavaScript and Json files.\n\n\n    `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'.\n\nDirectories that do not pass a filter will not be recursed into.","readmeFilename":"README.md","_id":"monocle@0.1.0","dist":{"shasum":"b9bfb9a4edd1953d196627f5957a0a2c03e1519f","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.0.tgz","integrity":"sha512-DpF5nDU2QDRjg32LSq3m4htA7QNMsX8BBbP6ZgUo2rSre/+sLKg4et8VTmDa0kH+uVb+xeuGFpUwDCreoPEmfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6t+AOoJFwkm3jqm4J/ug9fyYXP3aW1X+hNbqJ5xZJvAiBiEbN1YyIQQwkop24ZiNaEEA/trIfQBlCqo2xCP3DliQ=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.1":{"name":"monocle","version":"0.1.1","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3","underscore":"~1.4.4"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things**\n\n`npm install monocle`\n\n`var Monocle = require('monocle')\n (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);\n`\n\n\n# Filters\n\nThere are three different ways to specify filters for files and directories respectively.\n\n- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry\n\n- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more\n    information.\n\n    Globstars (`**`) are not supported since specifiying a recursive pattern for an already recursive function doesn't make sense.\n\n    Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files.\n\n- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown.\n\n    `[ '*.json', '*.js' ]` includes all JavaScript and Json files.\n\n\n    `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'.\n\nDirectories that do not pass a filter will not be recursed into.","readmeFilename":"README.md","_id":"monocle@0.1.1","dist":{"shasum":"8c6cb02dfc78f30451a9366ab14f4dee282b28d1","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.1.tgz","integrity":"sha512-96lcjH13tfm4mEVvmQUyQ90WSK6Z70RV9JCibdgbhwoYwVZx8986C+EljMZDNLNZ6IasQwRd/CbnPFhFiHxkDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwvOdCP9xaTFsdUbO9pS3ECn6Zi28onHq/tOvzrb5YXwIgQEhVTUhXrPJhUtdmS/T0s2Rc+RXth/nKBi1Var6y3wI="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.15":{"name":"monocle","version":"0.1.15","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3","underscore":"~1.4.4"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n`npm install monocle`\n\n\n`var Monocle = require('monocle')`\n\n` (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);`\n\nthe callback gets the filename that was modified\n\n## Filters\n\n- Read about it here [READDIRP](https://github.com/thlorenz/readdirp)","readmeFilename":"README.md","_id":"monocle@0.1.15","dist":{"shasum":"312f4e86c2b580531868e937315562a7607d0d7b","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.15.tgz","integrity":"sha512-Lt5RM2CASnlMX8t2Gn/AtNkoRbU3wQWAvruejOa0w44sFOnIbbh24wWFGKn74NRaCd5MjwCa3RJeZAuNJ8cVbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp61pnVAKC+K+hFcZ6GCbWutkNp3MzEzfxbOl3qZ4iQAIhAOuYoRIBMvQcbdr0KVro0t7/I/XbDgMu0x6BFuHXqXsG"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.2":{"name":"monocle","version":"0.1.2","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3","underscore":"~1.4.4"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n`npm install monocle`\n\n\n`var Monocle = require('monocle')`\n\n` (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);`\n\nthe callback gets the filename that was modified\n\n## Filters\n\n- Read about it here [READDIRP](https://github.com/thlorenz/readdirp)","readmeFilename":"README.md","_id":"monocle@0.1.2","dist":{"shasum":"fc609ea794488d9362b70b51c71bc8a461eeddcc","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.2.tgz","integrity":"sha512-1Qaiq2I1YgO8/xlVv4YwXjS5mfX5SMW9gtzv2e4BD43NJeNcNxT7211Llc0/zn7exp1zGLySeIEflCBrR7FtzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWfnjBNmtYvRFODZkDss5iW/cDHR3BiERKU3+E6xfg/AiAXUS1QRiDoeij2tubAAdbbx6NztJcLr4PNiMzOMmbLMw=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.3":{"name":"monocle","version":"0.1.3","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3","underscore":"~1.4.4"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n`npm install monocle`\n\n\n`var Monocle = require('monocle')`\n\n` (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);`\n\n### or watch an array of files\n\n` (new Monocle).watchFiles(files[], cb, watchSetupComplete);`\n\nthe callback gets the filename that was modified\n\n## Filters\n\n- Read about it here [READDIRP](https://github.com/thlorenz/readdirp)","readmeFilename":"README.md","_id":"monocle@0.1.3","dist":{"shasum":"e511e4364a4ce6bdb519fa84b244f22dd3688dcb","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.3.tgz","integrity":"sha512-cKyEQ95ljkIsfk6ZkBmk1gYrVMMMHtUEBF4c/L+vq5yXIqnWJfifo5qHzfuV8RrmobfEdtZBgovGinjiBVNb3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBtC3IyBQCwv69gPJ6JsFZ+Zvlk1SCUv23XwGduUa/tJAiB7Zl0NLHLK5PY8U3ege/TTEqUugoyVPJ1FuLilibXUtw=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.4":{"name":"monocle","version":"0.1.4","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n`npm install monocle`\n\n\n`var Monocle = require('monocle')`\n\n` (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);`\n\n### or watch an array of files\n\n` (new Monocle).watchFiles(files[], cb, watchSetupComplete);`\n\nthe callback gets the filename that was modified\n\n## Filters\n\n- Read about it here [READDIRP](https://github.com/thlorenz/readdirp)","readmeFilename":"README.md","_id":"monocle@0.1.4","dist":{"shasum":"9df5b3adff2a177036b6e2bf19cdb5cfa2b418eb","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.4.tgz","integrity":"sha512-jrg8dXdUfGA8tqtGyE6glYrW4rBfi12ew3JbLeQQ7qas6+ful9pH5dscww3QL5hCLNkJAWUuIplLALE+EJRtkA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC5Jsdw2SYiRdI0r3MM4SwVzlYDJ5iCq5CKILcgntxscAiA9vmkydCR59AUdFBtz5RyTakqptDq/WG1fopfQPnf0yg=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.40":{"name":"monocle","version":"0.1.40","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n## Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## How to use\n\n`npm install monocle`\n\n`var Monocle = require('monocle')()`\n\n    Monocle.watchDirectory({\n      root: <root directory>,\n      fileFilter: <optional>,\n      directoryFilter: <optional>,\n      complete: <fn>, //triggered on file change\n      callback: fn(filename) //file watching all set up\n    });\n\n##### Or watch a list of files\n\n    Monocle.watchFiles({\n      files: [], //path of file(s)\n      callback: <cb(filename)>, //triggered on file change\n      complete: <fn> //file watching all set up\n    });\n\n## Why?\n#### Why not just use fs.watch ?\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n## Filters\n\n- Read about it here [READDIRP](https://github.com/thlorenz/readdirp)\n","readmeFilename":"README.md","_id":"monocle@0.1.40","dist":{"shasum":"a1c15651a971c2d1c20de16fb3764460752f7c6d","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.40.tgz","integrity":"sha512-FuGGwndCiatot3NhEsyD2XCzjYE1N3TpCM3VWo0hF44N7wYifHwspin6iQrVUMzN5GJZPb1I28TMXSa0muvkpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfdrtmqj9OJ+0zDiTT8JzmFpz86MdaAZjT/AQcfK3kdAiA5v22mbuZH/BVosmoyXiEnJS4a7OJtJJ2iCWoqTQiuMQ=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.41":{"name":"monocle","version":"0.1.41","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  callback: fn(filename), //triggered on file change\n  complete: <fn> //file watching all set up\n});\n```\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  callback: <cb(filename)>, //triggered on file change\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.41","dist":{"shasum":"decc2ad3d7e7fdc2ccfea76b13fd5300a9e9a14c","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.41.tgz","integrity":"sha512-AlhSW/5WQmrw9/VgZN/0IYiL7J+AoZmGbaV0XWkiWhPp/JLAkXAnTC5eHQx9QC72/crYUuA3cJbqNwGpRy5DoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdMYFJi9wqoxF1oreRyGMaflwvDE8RwpvI4f+qUbWVyAIhAMV5llMBKktJrz0xB6V02FSGsxQEhNdC7suDY1dI/eOb"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.42":{"name":"monocle","version":"0.1.42","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  callback: fn(filename), //triggered on file change\n  complete: <fn(fs.stat+ object)> //file watching all set up\n});\n```\n\nThe callback will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified callback.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  callback: <fn(fs.stat+ object)>, //triggered on file change\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.42","dist":{"shasum":"f19175fec9ba79c937fb2a3149650dd94716e3ff","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.42.tgz","integrity":"sha512-g1IayDq9ruEsZ0q2tgkDeAOMuCDMzNhXTfCqy45Tx+wmxSk5T5Vlumhbbd++F9uaclWSVNGn690+dqJ2IbWzzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe2RBY6viOpLNILZAgk9hLHToqsxEADxagJOrLjUu7NwIhAJmABWAuLMOAYSyd95lwLAxzmjpgcJmBbemMB9o/3+BQ"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.43":{"name":"monocle","version":"0.1.43","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.43","dist":{"shasum":"644d0e91bd8515bc00ef78a8ac379578332e82b9","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.43.tgz","integrity":"sha512-JQDW6J+mDEP7M8c0QjlLdUxybnGyqjUVo0+jrcrCh5NeEWA50vuQKHbJSaFGT/2G9E/BgDKmsMDK1fno4LvS4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIshqkVQ9h7w4MWn1IsX6ZmZJYUCnnWFsVFoxQfUm7UwIhAK4H919C5odxqaRtqiYGEAcwmtb+LLytmzbLaxf7tuEH"}]},"_npmVersion":"1.2.0","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.45":{"name":"monocle","version":"0.1.45","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.45","dist":{"shasum":"9d29d228ce5830fb11b5aaf7d081f88824f558ad","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.45.tgz","integrity":"sha512-1aZ/QY/dM55+zdN0LyFWUMPWUbk+ETgId4pZ2yZwhlZX/tkf4hCaPdsn7aa6wZbyhXVG71PwYpNvzr6X+Mhh0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDk+PcouYo0tswIiTaGF1oGSpu/jsZu/3FFLiXZ4PqZKAiBH9ssONbkWaBZwTl9+DCiJLtKktIYk6tzdJ3bV5r4ezg=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.46":{"name":"monocle","version":"0.1.46","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.46","dist":{"shasum":"32ff9137fd3ee31d2d69a29db2f8a69389cd9860","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.46.tgz","integrity":"sha512-Mk5nj51Hg43397yDiDKks2CDnqT1LZJBjLgBZ5+rlQQ+2sVspPtSltKiulBVZvKRWtVELnk6+ZHUjwM6l+wVoA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEIM1pDt1LGK43Va1P/JcYlRcEF9Jhg1rGa6YbhfZGrwAiB8TnfSxjUIneB1AVmkN1YcagtwqwXbhjIhWJJ3+8JQzA=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.47":{"name":"monocle","version":"0.1.47","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":"","keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.47","dist":{"shasum":"5bf672efd238740a14d2352f77ff2ff1c9c768d3","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.47.tgz","integrity":"sha512-IdTkgboGaC6d1tZ3fSkI+FwswrSpuvg0pmGkw++yy7kDzGErtLEAMjVisHC7kxydVaNfsxKG6EL3gW1iBDAe4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA4aXMUgKR0jCi/4153zcSdNzcVrIXPCqnG2K956SY/zAiACNlgWHqF4uTb3YJ9i8yCMGtA0DDTWAhUlsAkCMUGt/Q=="}]},"_npmVersion":"1.2.0","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.48":{"name":"monocle","version":"0.1.48","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":{"type":"git","url":"https://github.com/samccone/monocle.git"},"bugs":{"url":"https://github.com/samccone/monocle/issues"},"keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.48","dist":{"shasum":"b96730f5ca900fa75a56041eb6db10aad980a383","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.48.tgz","integrity":"sha512-QW9bwJPOR8HOYyqRnukMQ8qRy/tBJuZuYaC/vXCbCUfZqhmO04+JeIKNWoJpgLqhvp5LQkSoDmKA3uKWZXXwDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0CcvE42LQCt8K9jXGqeIC5ONuPiLaqtYIWMrvQ6rwdAiEAtltE2KqclnZ4vFVp6k5+OMnV/H25JomsrLCPXZm59WY="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"0.1.50":{"name":"monocle","version":"0.1.50","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":{"type":"git","url":"https://github.com/samccone/monocle.git"},"bugs":{"url":"https://github.com/samccone/monocle/issues"},"keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n### Just watch path\n\nJust an alias of `watchFiles` and `watchDirectory` so you don't need to tell if that's a file or a directory by yourself. Parameter passed to `path` can be a `string` or a `array` of `string`.\n\n```js\nMonocle.watchFiles({\n  path: [], //list of pathes, or a string of path\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@0.1.50","dist":{"shasum":"9a7cbd0ccc10de95fd78a04b9beb2482ae4940b7","tarball":"https://registry.npmjs.org/monocle/-/monocle-0.1.50.tgz","integrity":"sha512-YT0QDamTT1slZmScdnA1jhxuG24S+EvWJTUkvgp3Pe4dCehbNE9Yw4wBZYBlfmj2zcjqBux3vM2pzh1EEYxYfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH1rovwqhdV+47YbUKiM2uc88WP/q3prRmVQMdrQKzmzAiAE491PSIa0NuwnNHEZ8NwwNFh7AJR0VDNzlwe4ULFpLQ=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"1.1.50":{"name":"monocle","version":"1.1.50","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 5000"},"repository":{"type":"git","url":"https://github.com/samccone/monocle.git"},"bugs":{"url":"https://github.com/samccone/monocle/issues"},"keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n### Just watch path\n\nJust an alias of `watchFiles` and `watchDirectory` so you don't need to tell if that's a file or a directory by yourself. Parameter passed to `path` can be a `string` or a `array` of `string`.\n\n```js\nMonocle.watchPaths({\n  path: [], //list of paths, or a string of path\n  fileFilter: <optional>, // `*.js` for example\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@1.1.50","dist":{"shasum":"e21b059d99726d958371f36240c106b8a067fa7d","tarball":"https://registry.npmjs.org/monocle/-/monocle-1.1.50.tgz","integrity":"sha512-vwHHIM9xp6ARQ82nvZSLMlVUI42BHJIxc4DYGEiKo192fryV1Dr7aWmVwPhDNlbawrmrT/GrGUYMYO50AyRMcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuBQ1JqsYC+W0l1IoLK6uo/nxQH5ZvrhOcxxWdlBK/tAiEAtyeZs7JA/pE6qvwiP34UFWx67pALntqC/wswWnZ0q9E="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]},"1.1.51":{"name":"monocle","version":"1.1.51","description":"a tool for watching directories for file changes","main":"monocle.js","directories":{"test":"test"},"dependencies":{"readdirp":"~0.2.3"},"devDependencies":{"mocha":"1.8.1"},"scripts":{"test":"mocha test -R spec -t 2000"},"repository":{"type":"git","url":"https://github.com/samccone/monocle.git"},"bugs":{"url":"https://github.com/samccone/monocle/issues"},"keywords":["watch","filesystem","folders","fs"],"author":{"name":"Sam Saccone"},"license":"BSD","readme":"[![Build Status](https://travis-ci.org/samccone/monocle.png?branch=master)](https://travis-ci.org/samccone/monocle)\n\n# Monocle -- a tool for watching things\n\n[![logo](https://raw.github.com/samccone/monocle/master/logo.png)](https://raw.github.com/samccone/monocle/master/logo.png)\n\nHave you ever wanted to watch a folder and all of its files/nested folders for changes. well now you can!\n\n## Installation\n\n```\nnpm install monocle\n```\n\n## Usage\n\n### Watch a directory:\n\n```js\nvar monocle = require('monocle')()\nmonocle.watchDirectory({\n  root: <root directory>,\n  fileFilter: <optional>,\n  directoryFilter: <optional>,\n  listener: fn(fs.stat+ object), //triggered on file change / addition\n  complete: <fn> //file watching all set up\n});\n```\n\nThe listener will recive an object with the following\n\n```js\n  name: <filename>,\n  path: <filepath-relative>,\n  fullPath: <filepath-absolute>,\n  parentDir: <parentDir-relative>,\n  fullParentDir: <parentDir-absolute>,\n  stat: <see fs.stats>\n```\n\n[fs.stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n\nWhen a new file is added to the directoy it triggers a file change and thus will be passed to your specified listener.\n\nThe two filters are passed through to `readdirp`.  More documentation can be found [here](https://github.com/thlorenz/readdirp#filters)\n\n### Watch a list of files:\n\n```js\nMonocle.watchFiles({\n  files: [], //path of file(s)\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n### Just watch path\n\nJust an alias of `watchFiles` and `watchDirectory` so you don't need to tell if that's a file or a directory by yourself. Parameter passed to `path` can be a `string` or a `array` of `string`.\n\n```js\nMonocle.watchPaths({\n  path: [], //list of paths, or a string of path\n  fileFilter: <optional>, // `*.js` for example\n  listener: <fn(fs.stat+ object)>, //triggered on file / addition\n  complete: <fn> //file watching all set up\n});\n```\n\n### Force to use fs.watch\n\nYou can use the USE_FS_WATCH env variable set to true, to force this behavior regardless of platform.\n\n## Why not just use fs.watch ?\n\n  - file watching is really bad cross platforms in node\n  - you need to be smart when using fs.watch as compared to fs.watchFile\n  - Monocle takes care of this logic for you!\n  - windows systems use fs.watch\n  - osx and linux uses fs.watchFile\n\n## License\n\nBSD\n","readmeFilename":"README.md","_id":"monocle@1.1.51","dist":{"shasum":"22ed16e112e9b056769c5ccac920e375249d89c0","tarball":"https://registry.npmjs.org/monocle/-/monocle-1.1.51.tgz","integrity":"sha512-G2ozHlK2+Z+oAvKSJ4pN0a7pLvCOWMDuHgtdARDt1uRyak9klMwg71ac37SWeULSzrkV0N75A0z9JaYtqXji1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCe1g/+yD++9fb2cp//v+jSuYRBSAZxuiQ46uSp42elLwIhALqQkJURj2ezYDCJShr2mYFWw6idvLWHE9MVzVOiTWQ+"}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"samccone","email":"samccone@gmail.com"},"maintainers":[{"name":"samccone","email":"samccone@gmail.com"}]}},"readme":"**Monocle -- a tool for watching things**\n\n`npm install monocle`\n\n`var Monocle = require('monocle')\n (new Monocle).watchDirectory(dir, cb, watchSetupComplete, fileFilers, directoryFilters);\n`\n\n\n## Filters\n\nThere are three different ways to specify filters for files and directories respectively.\n\n- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry\n\n- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more\n    information.\n\n    Globstars (`**`) are not supported since specifiying a recursive pattern for an already recursive function doesn't make sense.\n\n    Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files.\n\n- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown.\n\n    `[ '*.json', '*.js' ]` includes all JavaScript and Json files.\n\n\n    `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'.\n\nDirectories that do not pass a filter will not be recursed into.","maintainers":[{"name":"samccone","email":"samccone@gmail.com"}],"time":{"modified":"2022-06-20T08:39:45.431Z","created":"2013-02-18T23:01:54.275Z","0.1.0":"2013-02-18T23:01:55.089Z","0.1.1":"2013-02-19T00:06:35.667Z","0.1.15":"2013-02-19T00:18:11.647Z","0.1.2":"2013-02-20T02:59:08.412Z","0.1.3":"2013-03-05T00:42:34.432Z","0.1.4":"2013-04-15T13:54:12.472Z","0.1.40":"2013-04-16T01:55:37.758Z","0.1.41":"2013-04-16T02:06:32.011Z","0.1.42":"2013-04-16T02:37:55.103Z","0.1.43":"2013-04-16T21:21:10.047Z","0.1.45":"2013-04-21T22:53:34.832Z","0.1.46":"2013-04-22T23:11:47.432Z","0.1.47":"2013-04-30T13:28:27.488Z","0.1.48":"2013-05-26T16:18:45.027Z","0.1.50":"2013-06-10T15:47:14.086Z","1.1.50":"2013-06-20T23:49:24.925Z","1.1.51":"2013-11-02T20:07:13.195Z"},"author":{"name":"Sam Saccone"},"users":{"pid":true,"tunnckocore":true,"geduardcatalin":true},"repository":{"type":"git","url":"https://github.com/samccone/monocle.git"}}