{"_id":"@bpa-solutions/tsc-watch","name":"@bpa-solutions/tsc-watch","dist-tags":{"latest":"6.0.1"},"versions":{"6.0.1":{"name":"@bpa-solutions/tsc-watch","version":"6.0.1","description":"The TypeScript compiler with onSuccess command. Small fork for BPA Solutions","scripts":{"clean":"rimraf dist && rimraf tmp","test":"npm run build && jest --verbose --runInBand","build":"npm run clean && npm run build-lib && npm run build-client","build-lib":"tsc -p tsconfig.json","build-client":"tsc -p tsconfig-client.json","watch-lib":"tsc -p tsconfig.json --watch"},"bin":{"tsc-watch":"dist/lib/tsc-watch.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/leomaradan/tsc-watch.git"},"keywords":["TypeScript"],"main":"./dist/client/index.js","types":"./dist/client/index.d.ts","engines":{"node":">=12.12.0"},"author":{"name":"Gil Amran"},"license":"MIT","bugs":{"url":"https://github.com/leomaradan/tsc-watch/issues"},"homepage":"https://github.com/leomaradan/tsc-watch#readme","prettier":{"trailingComma":"all","tabWidth":2,"semi":true,"singleQuote":true,"printWidth":100},"dependencies":{"cross-spawn":"^7.0.3","node-cleanup":"^2.1.2","ps-tree":"^1.2.0","string-argv":"^0.3.1"},"peerDependencies":{"typescript":"*"},"devDependencies":{"@types/cross-spawn":"^6.0.2","@types/jest":"^27.4.1","@types/node":"^12.12.0","@types/node-cleanup":"^2.1.2","@types/ps-tree":"^1.1.2","fs-extra":"^10.0.1","jest":"^27.5.1","rimraf":"^3.0.2","ts-jest":"^27.1.4","typescript":"^4.6.3"},"gitHead":"cffd465e10bcc8146adf808c6b62cfc791b25f84","_id":"@bpa-solutions/tsc-watch@6.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-tmba5TYwMGLroxrjFDjE6BeTQOSXVuDFiMtdduB+0P14WVJmqeWJY8K0s83lWmvsAkJuuxumoZKirAhdxRB6IA==","shasum":"0e0e0e947149434dd134e109b7cb68544a978307","tarball":"https://registry.npmjs.org/@bpa-solutions/tsc-watch/-/tsc-watch-6.0.1.tgz","fileCount":16,"unpackedSize":30120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLHfMzGDCikreTErxtAbDmWBiRLCLpSE/qzaXMDJ+goAIgHKdZz1Rx4CjfzR6LcP21Wz3pIE3Q5cocPkiKfx4BITs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpA8RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrLbg//RTuhwIWQAk90P2XmxZy62AyLNG58yRQuAC6LKO9u/cWEp5+w\r\nWdKJAqmQ0HFn8/gkiPNUnM9g7YsnEF1X8r8Gk0zhsX60lWPDF1j8b1wlTT6u\r\nK+iz3txmlyhcOcARbZ1qLPrML5WkjZYHYZP84a3B80f2z504SeSFT9IPGMVW\r\nzMAVYdhjazQI4EIWpDRkU15uOxVxzjEOeC/fCwBhOhND3wSWOc7YiEIVNUMz\r\n+68zD72gBa3Y1Tt2LfGTbtXjpoSjum4Uco9vaXECUs0Rt5olXZqaGdJwqsWn\r\niwATfEfBYDbRC2XtbOdl4oZjJXYcWeHJQkE/Yao3iLBpnyrsBQAxolrtvQUc\r\nUT0bgcHhcApJgD9y3qeTm3+WDJy7YAnNDdBEkbdA2o2UtIMtxtp9ST1gyBag\r\nZKa/4XqbYATRXyOLQm6ih7HJfZyoF8ogfUI8hWXSP7aNHopnH5qzdas0UOSi\r\n1lyxGvAIb+ph/LYuYFmPhXp8Qer+bS6JRrjVsbx9eiMqIuSgd67bozTPHrID\r\nu3R00vANoyAVaB0CF5ufczzSYlQX55j3gDq92wiUcBbboc1OoPiGASiXBUie\r\nr8FJqbCAJzOVi983DrdWcQqwIFDQpKQyZzQp/FPMMewZpNwZf7TjE5D2gft4\r\n1VVyWNOscMEMCZj/gfaB4lp5tNE5S6haTtY=\r\n=YPV2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"leomaradan","email":"npm@leomaradan.com"},"directories":{},"maintainers":[{"name":"leomaradan","email":"npm@leomaradan.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tsc-watch_6.0.1_1671696145324_0.6867186961697345"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-22T08:02:25.239Z","6.0.1":"2022-12-22T08:02:25.526Z","modified":"2022-12-22T08:02:25.681Z"},"maintainers":[{"name":"leomaradan","email":"npm@leomaradan.com"}],"description":"The TypeScript compiler with onSuccess command. Small fork for BPA Solutions","homepage":"https://github.com/leomaradan/tsc-watch#readme","keywords":["TypeScript"],"repository":{"type":"git","url":"git+ssh://git@github.com/leomaradan/tsc-watch.git"},"author":{"name":"Gil Amran"},"bugs":{"url":"https://github.com/leomaradan/tsc-watch/issues"},"license":"MIT","readme":"[![Build Status](https://travis-ci.com/gilamran/tsc-watch.svg?branch=master)](https://travis-ci.com/gilamran/tsc-watch)\n\n# The nodemon for TypeScript\n\n`tsc-watch` starts the installed TypeScript compiler (`tsc`) with `--watch` parameter, with the ability to react to compilation status.\n`tsc-watch` was created to allow an easy dev process with TypeScript. Commonly used to restart a node server, similar to nodemon but for TypeScript.\n\n**Anything that you can do with `tsc` you can do with `tsc-watch`, the only difference is that `tsc-watch` can react to compilation status.**\n\n| Argument | Description |\n|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `--onSuccess COMMAND` | Executes `COMMAND` on **every successful** compilation. |\n| `--onFirstSuccess COMMAND` | Executes `COMMAND` on the **first successful** compilation. |\n| `--onFailure COMMAND` | Executes `COMMAND` on **every failed** compilation. |\n| `--onCompilationStarted COMMAND` | Executes `COMMAND` on **every compilation start** event (initial and incremental). |\n| `--onCompilationComplete COMMAND` | Executes `COMMAND` on **every successful or failed** compilation. |\n| `--maxNodeMem` | Calls `node` with a specific memory limit `max_old_space_size`, to use if your project needs more memory. |\n| `--noColors` | By default tsc-watch adds colors the output with green<br>on success, and in red on failure. <br>Add this argument to prevent that. |\n| `--noClear` | In watch mode the `tsc` compiler clears the screen before reporting<br>Add this argument to prevent that. |\n| `--signalEmittedFiles` | Will run `tsc` compiler with `--listEmittedFiles`, but hiding TSFILE lines. Use it to enable `file_emitted` event, while keeping tsc stdout silent. |\n| `--silent` | Do not print any messages on stdout. |\n| `--compiler PATH` | The `PATH` will be used instead of typescript compiler.<br>Default is `typescript/bin/tsc` |\n\nNotes:\n\n* That all the above `COMMAND`s will be killed on process exit. (Using `SIGTERM`)\n  \n* A `COMMAND` is a single command and not multi command like `script1.sh && script2.sh`\n  \n* Any child process (`COMMAND`) will be terminated before creating a new one.\n\n## Install\n\n```sh\nnpm install tsc-watch --save-dev\n```\n\n```sh\n## for command-line usage\nnpm install -g typescript tsc-watch\n```\n\n## Usage\n\n### From Command-Line\n\n```sh\n## Watching a project (with tsconfig.json)\ntsc-watch --onSuccess \"node ./dist/server.js\"\n\n## Beep on failure\ntsc-watch --onFailure \"echo Beep! Compilation Failed\"\n\n## Watching a single file\ntsc-watch server.ts --outDir ./dist --onSuccess \"node ./dist/server.js\"\n\n## Custom compiler\ntsc-watch --onSuccess \"node ./dist/server.js\" --compiler my-typescript/bin/tsc\n```\n\n### From npm script\n```\n\"dev-server\": \"tsc-watch --noClear -p ./src/tsconfig.json --onSuccess \\\"node ./dist/server.js\\\"\",\n```\n\n### From javascript\n\nYou can see a detailed example [here](https://github.com/gilamran/tsc-watch/blob/master/tsc-watch-client-example.js)\n\nThe client is implemented as an instance of `Node.JS`'s `EventEmitter`, with the following events:\n\n- `started` - Emitted upon the compilation start (initial or incremental).\n- `first_success` - Emitted upon first successful compilation.\n- `subsequent_success` - Emitted upon every subsequent successful compilation.\n- `compile_errors` - Emitted upon every failing compilation.\n- `file_emitted` - Emitted upon every file transpiled if `--listEmittedFiles` is used.\n\nOnce subscribed to the relevant events, start the client by running `watch.start()`\n\nTo kill the client, run `watch.kill()`\n\nExample usage:\n\n```javascript\nconst TscWatchClient = require('tsc-watch/client');\nconst watch = new TscWatchClient();\n\nwatch.on('started', () => {\n  console.log('Compilation started');\n});\n\nwatch.on('first_success', () => {\n  console.log('First success!');\n});\n\nwatch.on('success', () => {\n  // Your code goes here...\n});\n\nwatch.on('compile_errors', () => {\n  // Your code goes here...\n});\n\nwatch.start('--project', '.');\n\ntry {\n  // do something...\n} catch (e) {\n  watch.kill(); // Fatal error, kill the compiler instance.\n}\n```\n\nNotes:\n\n- The (`onSuccess`) `COMMAND` will not run if the compilation failed.\n- `tsc-watch` is using the currently installed TypeScript compiler.\n- `tsc-watch` is not changing the compiler, just adds the new arguments, compilation is the same, and all other arguments are the same.\n","readmeFilename":"README.md"}