All Projects → gilamran → Tsc Watch

gilamran / Tsc Watch

Licence: mit
The TypeScript compiler with --watch and a new onSuccess argument

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Tsc Watch

nodemand
Restart Node.js process on required modules change.
Stars: ✭ 21 (-94.63%)
Mutual labels:  watch, nodemon
Nodemon
Monitor for any changes in your node.js application and automatically restart the server - perfect for development
Stars: ✭ 23,377 (+5878.77%)
Mutual labels:  watch, nodemon
express-mysql-rest
Building the simple api with sequelize, mysql and express js. this repository contains the code about how to use sequelize with mysql at express js. for example i have provide the crud operation to this repository. You can also testing the api with chai and mocha with chai-http by this repository
Stars: ✭ 25 (-93.61%)
Mutual labels:  nodemon
Commit Watcher
Find interesting and potentially hazardous commits in git projects
Stars: ✭ 345 (-11.76%)
Mutual labels:  watch
angular-expression-parser
This library helps in achieving AngularJs equivalents of $parse, $eval and $watch in Angular.
Stars: ✭ 17 (-95.65%)
Mutual labels:  watch
ahobsu-node-backend
🌈 MOTI ! Make Own True Identity ⭐️ 유니큐와 유초코파이 노드로 탈주하다😎
Stars: ✭ 16 (-95.91%)
Mutual labels:  nodemon
ebay-watcher
Get your listing to the top of eBay search results!
Stars: ✭ 38 (-90.28%)
Mutual labels:  watch
SwiftUI-Shimmer
Shimmer is a super-light modifier that adds a shimmering effect to any SwiftUI View, for example, to show that an operation is in progress. It works well on light and dark modes, and across iOS, macOS, tvOS and watchOS.
Stars: ✭ 168 (-57.03%)
Mutual labels:  watch
React Native Watch Connectivity
Enable communication between iWatch app and react native
Stars: ✭ 377 (-3.58%)
Mutual labels:  watch
FacePorts
Clockology ports of all the watch faces that Apple withholds from certain watch models
Stars: ✭ 27 (-93.09%)
Mutual labels:  watch
Fileboy
fileboy,文件变更监听通知工具,使用 Go 编写。Fileboy, File Change Monitoring Notification Tool, written with Go.
Stars: ✭ 345 (-11.76%)
Mutual labels:  watch
twitch-chat-visualizer
A Node.js Project. Would you like to see your chat stream with a custom design? This is for you!
Stars: ✭ 14 (-96.42%)
Mutual labels:  nodemon
haversine-rest-api
This Api compares results returned by ‘Haversine’ formula and MongoDB Geospatial Indexes.
Stars: ✭ 16 (-95.91%)
Mutual labels:  nodemon
Watchface Constructor
This is simple watchface constructor demo
Stars: ✭ 275 (-29.67%)
Mutual labels:  watch
toxic-decorators
Library of Javascript decorators
Stars: ✭ 26 (-93.35%)
Mutual labels:  watch
Express Starter
🚚 A boilerplate for Node.js, Express, Mongoose, Heroku, Atlas, Nodemon, PM2, and Babel. REST / GraphQL API Server | PaaS | SaaS | CI/CD | Jest | Supertest | Docker | MongoDB | PostgreSQL | Sequelize | Lodash | RxJS | JWT | Passport | WebSocket | Redis | CircleCI | Apollo | DevSecOps | Microservices | Backend Starter Kit | ES6
Stars: ✭ 353 (-9.72%)
Mutual labels:  nodemon
compose-watcher
Watch volumes and restart services in docker compose
Stars: ✭ 27 (-93.09%)
Mutual labels:  watch
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-90.54%)
Mutual labels:  watch
Twelveish
🕛 Twelveish - Android Wear/Wear OS Watch Face
Stars: ✭ 29 (-92.58%)
Mutual labels:  watch
Js Stack From Scratch
🛠️⚡ Step-by-step tutorial to build a modern JavaScript stack.
Stars: ✭ 18,814 (+4711.76%)
Mutual labels:  nodemon

Build Status

The nodemon for TypeScript

tsc-watch starts a TypeScript compiler with --watch parameter, with the ability to react to compilation status. 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.

Argument Description
--onSuccess COMMAND Executes COMMAND on every successful compilation.
--onFirstSuccess COMMAND Executes COMMAND on the first successful compilation.
--onFailure COMMAND Executes COMMAND on every failed compilation.
--onCompilationComplete COMMAND Executes COMMAND on every successful or failed compilation.
--noColors By default tsc-watch adds colors the output with green
on success, and in red on failure.
Add this argument to prevent that.
--noClear In watch mode the tsc compiler clears the screen before reporting
Add this argument to prevent that.
--compiler PATH The PATH will be used instead of typescript compiler.
Default is typescript/bin/tsc

Notes:

  • That all the above COMMANDs will be killed on process exit. (Using SIGTERM)

  • A COMMAND is a single command and not multi command like script1.sh && script2.sh

  • Any child process (COMMAND) will be terminated before creating a new one.

Install

npm install tsc-watch --save-dev

Usage

From Command-Line

## Watching a project (with tsconfig.json)
tsc-watch --onSuccess "node ./dist/server.js"

## Beep on failure
tsc-watch --onFailure "echo Beep! Compilation Failed"

## Watching a single file
tsc-watch server.ts --outDir ./dist --onSuccess "node ./dist/server.js"

## Custom compiler
tsc-watch --onSuccess "node ./dist/server.js" --compiler my-typescript/bin/tsc

From Code

The client is implemented as an instance of Node.JS's EventEmitter, with the following events:

  • first_success - Emitted upon first successful compilation.
  • subsequent_success - Emitted upon every subsequent successful compilation.
  • compile_errors - Emitted upon every failing compilation.

Once subscribed to the relevant events, start the client by running watch.start()

To kill the client, run watch.kill()

Example usage:

const TscWatchClient = require('tsc-watch/client');
const watch = new TscWatchClient();

watch.on('first_success', () => {
  console.log('First success!');
});

watch.on('success', () => {
  // Your code goes here...
});

watch.on('compile_errors', () => {
  // Your code goes here...
});

watch.start('--project', '.');

try {
  // do something...
} catch (e) {
  watch.kill(); // Fatal error, kill the compiler instance.
}

Notes:

  • The (onSuccess) COMMAND will not run if the compilation failed.
  • tsc-watch is using the currently installed TypeScript compiler.
  • tsc-watch is not changing the compiler, just adds the new arguments, compilation is the same, and all other arguments are the same.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].