wclr / ts-node-dev

Compiles your TS app and restarts when files are modified.
MIT License
3.43k stars 123 forks source link

How to use ts-node-dev in js file like nodemon #350

Open kelefun opened 4 days ago

kelefun commented 4 days ago

I want use ts-node-dev in script.js ,but don't know how . How to using ts-node-dev like nodemon below

var nodemon = require('nodemon');

nodemon({ script: 'app.js' }).on('start', function () {
  console.log('nodemon started');
}).on('crash', function () {
  console.log('script crashed for some reason');
});

// force a restart
nodemon.emit('restart');

// force a quit
nodemon.emit('quit');
wclr commented 4 days ago

It is not intended to work as nodemon, you probably can use nodemon to run TS.