{"_id":"@egoist/nswatch","name":"@egoist/nswatch","dist-tags":{"latest":"0.3.1"},"versions":{"0.3.1":{"name":"@egoist/nswatch","publishConfig":{"access":"public"},"version":"0.3.1","type":"module","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":"git://github.com/egoist"},"engines":{"node":">=16"},"scripts":{"test":"echo lol","build":"tsup src/index.ts src/cli.ts --format esm","prepublishOnly":"npm run build"},"main":"./dist/index.js","bin":{"nswatch":"dist/cli.js"},"keywords":["watcher","watcher","npm script"],"dependencies":{"cac":"^6.7.14","chokidar":"^3.5.3","colorette":"^2.0.19","cross-spawn":"^4.0.2","joycon":"^3.1.1","read-pkg":"^2.0.0","zod":"^3.20.6"},"devDependencies":{"@types/cross-spawn":"^6.0.2","tsup":"^6.6.3","typescript":"^4.9.5"},"gitHead":"8f5d8e285ba7be1e2dbfd9d134648a7a820b1b9e","bugs":{"url":"https://github.com/egoist/nswatch/issues"},"homepage":"https://github.com/egoist/nswatch#readme","_id":"@egoist/nswatch@0.3.1","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-KIqye+d59Se+2DlEvI9tL3HoCG757sUZJBYz/jy1a0tsu6cHJwqKPakHu9zDULWTDwSXPB4JqDH0g/3saVQACQ==","shasum":"15747627c77a31a35a96da415edee19b4c946bdf","tarball":"https://registry.npmjs.org/@egoist/nswatch/-/nswatch-0.3.1.tgz","fileCount":7,"unpackedSize":9981,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMLAwTg+5Bv0z8BN3xgWdgpTcJujkQApv/XHwaeehq7wIhAOmpvoktgN2Oo/MNfi2YlbwGIh5HrwOpx/SxYh7olybu"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+hwvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6og/6AjDB4S1a7ripIy9aJE5hNhzl9NN1M6CfMdsZxIpiIiXttP1J\r\nu1OpamTFFRTMfa7jC9mHsLdbcHgMvtnOaMQNvfnoUYsbouHt7LioIbWH+Byd\r\nYWztGIVEj3wCvWgVwLjM0dFEhrl77A/mEHea+rl5cmyr3ABGCAomNeCqcHX9\r\nMq789HPcwf1v+be/v2D+ej5xANrCdwoYnDva9HGrHUyDEIMrAwX9qzp8nFAQ\r\nkK5+HQnqovvC/WHUt5aoYUqslXGZp8iDzEH9FgqJBR5JcaV9z2Jcp0ulfBa8\r\neoF+wBsRnCKrHuo6ovqzZFcghRK7hjSnJ3xBydztQfKhESiQC/Yh0peswpGp\r\nQpJIrv1QAuJB8+/Q3L0kwUkAPBwPLsVEccZ1MltTWg8KjCsgQGBGn4TYySBH\r\nwIWf8Iemaw6Hh1DigoawK8rFFAlPAjEfz60C73VmJ4dc65Rbwy2/wmpR2b3c\r\nkxTAOLKanJxdsD//Ot6WgwnujUKWR+WMsA1ZFilDx093b/121eh531lklfOM\r\n+Jbeck1eZR6Qq1S7893vxS4R5NPOfeEXYl/OD0tdGQqQD8omt9bUhV/mTbHw\r\nJZC2LbDod6rbCT/bbl6r4pUWio/57xMEo4R1X7LB2mgrS2YGrckKt115ZWYP\r\n1J/5h5uj5VD4z9RCpknr8R5jlCsAPyD441g=\r\n=M0J3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"egoist","email":"0x142857@gmail.com"},"directories":{},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nswatch_0.3.1_1677335599610_0.364728050647251"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-25T14:33:19.520Z","0.3.1":"2023-02-25T14:33:19.821Z","modified":"2023-02-25T14:33:20.071Z"},"maintainers":[{"name":"egoist","email":"0x142857@gmail.com"}],"description":"Like gulp.watch but for npm scripts.","homepage":"https://github.com/egoist/nswatch#readme","keywords":["watcher","watcher","npm script"],"repository":{"type":"git","url":"git+https://github.com/egoist/nswatch.git"},"author":{"name":"egoist","email":"0x142857@gmail.com","url":"git://github.com/egoist"},"bugs":{"url":"https://github.com/egoist/nswatch/issues"},"license":"MIT","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\nimport { watch } from \"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","readmeFilename":"README.md"}