{"_id":"nswatch","_rev":"1760842","name":"nswatch","description":"Like gulp.watch but for npm scripts.","dist-tags":{"latest":"0.2.0"},"maintainers":[{"name":"kchan","email":"kchanzen@gmail.com"}],"time":{"modified":"2026-11-26T08:02:32.000Z","created":"2016-08-29T04:54:41.413Z","0.2.0":"2016-09-02T05:45:34.026Z","0.1.1":"2016-08-29T10:32:28.075Z","0.1.0":"2016-08-29T04:54:41.413Z"},"users":{},"author":{"name":"egoist","email":"0x142857@gmail.com","url":"github.com/egoist"},"repository":{"type":"git","url":"git+https://github.com/egoist/nswatch.git"},"versions":{"0.2.0":{"name":"nswatch","version":"0.2.0","description":"Like gulp.watch but for npm scripts.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/egoist/nswatch.git"},"author":{"name":"egoist","email":"0x142857@gmail.com","url":"github.com/egoist"},"engines":{"node":">=4"},"scripts":{"test":"xo src/*.js","build":"bubleup"},"watch":{"src":["build"]},"bin":{"nswatch":"cli.js"},"files":["cli.js","index.js"],"keywords":[],"devDependencies":{"ava":"latest","xo":"latest"},"xo":{"semicolon":false,"space":2,"rules":{"operator-linebreak":[2,"before"]}},"dependencies":{"cac":"^2.2.0","chalk":"^1.1.3","chokidar":"^1.6.0","cross-spawn":"^4.0.0","read-pkg":"^1.1.0"},"gitHead":"fc434ea6494831b205d43319fca739971a0fc625","bugs":{"url":"https://github.com/egoist/nswatch/issues"},"homepage":"https://github.com/egoist/nswatch#readme","_id":"nswatch@0.2.0","_shasum":"be9fe0d146f727385c3430b6b3df3a32ee5df2f5","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"kchan","email":"kchanzen@gmail.com"},"dist":{"shasum":"be9fe0d146f727385c3430b6b3df3a32ee5df2f5","tarball":"http://registry-npm.ywwl.com/nswatch/download/nswatch-0.2.0.tgz","integrity":"sha512-StbD/Z2nEIbPxUlwUOxO2sy9NtrNoLjooXxS+laVKDMh7WtXNw4OlS1wkDr+++hVUL37+7QHJE7YMszaU/kjng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPofonwAu366iIkk2nASs8xxR3WLz++glsB3XhWjXp/AIhANXYDU/IXiV9Of7yS37khwEQJm0JwUFNRbn7N9Z9ulLz"}],"size":3347,"noattachment":false,"key":"/nswatch/-/nswatch-0.2.0.tgz"},"maintainers":[{"name":"kchan","email":"kchanzen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/nswatch-0.2.0.tgz_1472795130766_0.24252557079307735"},"publish_time":1472795134026,"_cnpm_publish_time":1472795134026},"0.1.1":{"name":"nswatch","version":"0.1.1","description":"Like gulp.watch but for npm scripts.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/egoist/nswatch.git"},"author":{"name":"egoist","email":"0x142857@gmail.com","url":"github.com/egoist"},"engines":{"node":">=4"},"scripts":{"test":"xo src/*.js","build":"bubleup"},"bin":{"nswatch":"cli.js"},"files":["cli.js","index.js"],"keywords":[],"devDependencies":{"ava":"latest","xo":"latest"},"xo":{"semicolon":false,"space":2,"rules":{"operator-linebreak":[2,"before"]}},"dependencies":{"cac":"^2.2.0","chalk":"^1.1.3","chokidar":"^1.6.0","cross-spawn":"^4.0.0"},"gitHead":"99d4f3fc1e8cc57fb49d583af0b5c2a1e1b0bfc1","bugs":{"url":"https://github.com/egoist/nswatch/issues"},"homepage":"https://github.com/egoist/nswatch#readme","_id":"nswatch@0.1.1","_shasum":"c07aad38ae926d376e091eb7d0609e2c38d8acbf","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"kchan","email":"kchanzen@gmail.com"},"dist":{"shasum":"c07aad38ae926d376e091eb7d0609e2c38d8acbf","tarball":"http://registry-npm.ywwl.com/nswatch/download/nswatch-0.1.1.tgz","integrity":"sha512-wMeiieuz+Bd8S/4M/SW3DUiKAmXhXNGj961kYPiZPqHVKZXxJH/r4++KA4ySrX8LTKu0aEM7y5OPIsZk1OqSVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtQQyMlUJsTZ9m7/fHNDuuRVl1krDdV6amkAGKG5r7JAiA4U3/D9gDlNctO6jFBSrcpagjVEbXVgPUTrYVRbZgc9Q=="}],"size":2919,"noattachment":false,"key":"/nswatch/-/nswatch-0.1.1.tgz"},"maintainers":[{"name":"kchan","email":"kchanzen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/nswatch-0.1.1.tgz_1472466747820_0.5855413991957903"},"publish_time":1472466748075,"_cnpm_publish_time":1472466748075},"0.1.0":{"name":"nswatch","version":"0.1.0","description":"Like gulp.watch but for npm scripts.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/egoist/nswatch.git"},"author":{"name":"egoist","email":"0x142857@gmail.com","url":"github.com/egoist"},"engines":{"node":">=4"},"scripts":{"test":"xo src/*.js","build":"bubleup"},"bin":{"nswatch":"cli.js"},"files":["cli.js","index.js"],"keywords":[],"devDependencies":{"ava":"latest","xo":"latest"},"xo":{"semicolon":false,"space":2,"rules":{"operator-linebreak":[2,"before"]}},"dependencies":{"cac":"^2.2.0","chalk":"^1.1.3","chokidar":"^1.6.0","cross-spawn":"^4.0.0"},"gitHead":"bef90308913113c64b69a63f8b56cacb8df912b7","bugs":{"url":"https://github.com/egoist/nswatch/issues"},"homepage":"https://github.com/egoist/nswatch#readme","_id":"nswatch@0.1.0","_shasum":"0b74f06535cc960bb193384b5c3e4ee3a0ef8a61","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"kchan","email":"kchanzen@gmail.com"},"dist":{"shasum":"0b74f06535cc960bb193384b5c3e4ee3a0ef8a61","tarball":"http://registry-npm.ywwl.com/nswatch/download/nswatch-0.1.0.tgz","integrity":"sha512-l2OzYDjBfTRcVZuudGQWhuB+oKld/16zryZO5gf3sIrFKx9zT3sTxtrkyrCNlPlacsAdBTcf0+yUh++q51gAHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTklmTZnF1NlASPZaEhyv/NcM5b6viV+OIcJJTQfQC9AiAEjJkWInNRCNsjBXVLXEmoDhOoV2GrB6o2E5ju6TN1pA=="}],"size":2874,"noattachment":false,"key":"/nswatch/-/nswatch-0.1.0.tgz"},"maintainers":[{"name":"kchan","email":"kchanzen@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/nswatch-0.1.0.tgz_1472446481168_0.36228380142711103"},"publish_time":1472446481413,"_cnpm_publish_time":1472446481413}},"readme":"# nswatch\n\n[![NPM version](https://img.shields.io/npm/v/nswatch.svg?style=flat-square)](https://npmjs.com/package/nswatch) [![NPM downloads](https://img.shields.io/npm/dm/nswatch.svg?style=flat-square)](https://npmjs.com/package/nswatch) [![Build Status](https://img.shields.io/circleci/project/egoist/nswatch/master.svg?style=flat-square)](https://circleci.com/gh/egoist/nswatch)\n\n> Like gulp.watch but for npm scripts.\n\n## Install\n\n```bash\n$ npm install -D nswatch\n```\n\n## Usage\n\nAssuming you have an npm script `build` to compile something, then drop a `watch.js` in your project:\n\n```js\nconst watch = require('nswatch')\n\nwatch('src/*.js', ['build'])\n```\n\nWhen you run `node watch`, the `npm run build` will be invoked right away, and will also be invoked when file changes are detected.\n\n<img src=\"./media/preview.png\" width=\"500\" />\n\n### Parallel and Sequence\n\n`Array` will be treated as parallel, `String` will be treated as sequence:\n\n```js\n// run in parallel\nwatch('src/a.js', ['task-a', 'task-b'])\n// run in sequence\n// use ! as seperator\nwatch('src/b.js', 'task-a!task-b')\n```\n\n## CLI\n\n```bash\n$ npm install -g nswatch\n```\n\nYou can also use `nswatch` as a command-line program:\n\n### Configure `watch` in `package.json`\n\n```json\n{\n  \"watch\": {\n    \"./src/*.js\": [\"build\"],\n    \"./src/*.css\": \"compile!minify\"\n  }\n}\n```\n\nThen run:\n\n```bash\n$ nswatch\n```\n\nOr you can pass the config via CLI arguments, this way configurations in `package.json` will be ignored.\n\n```bash\n# in parallel\n$ nswatch \"src/*.js\" --script foo --script bar\n\n# in sequence\n$ nswatch \"src/*.js\" --script \"foo!bar\"\n```\n\n## Author\n\n**nswatch** © [EGOIST](https://github.com/egoist), Released under the [MIT](https://egoist.mit-license.org/) License.<br>\nAuthored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/nswatch/contributors)).\n\n> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)\n","_attachments":{},"homepage":"https://github.com/egoist/nswatch#readme","bugs":{"url":"https://github.com/egoist/nswatch/issues"},"license":"MIT"}