3 ms·
For anyone working on Nodejs targeted TypeScript I would highly recommend checking out ts-node. I use it a ton when I want to not worry about the pre-compilatio
by Rapzid 8y ago
For anyone working on Nodejs targeted TypeScript I would highly recommend checking out ts-node. I use it a ton when I want to not worry about the pre-compilation step for various reasons. Can work with absolute imports, and caches code on the first run as well. Pretty sweet.
https://github.com/TypeStrong/ts-node https://github.com/TypeStrong/ts-node
Article mentions ts-jest; can also recommend. I use Jest for all my TS projects from serverless to selenium. Its watch mode is fantastic.
I also typically use ts-loader with Webpack instead of Babel.
Eh, might as well toss a few more recommendations in there:
* source-map-support
* Bluebird for long stack traces with async/await(v8 now has a zero-cost feature behind a flag now though as of end of 2018)
* Get the debugger hooked up to your browser/nodejs process for a great debug experience
- jelling 8y agoWe use it but it can cause complications with other tools that expect compiled JavaScript such as testing and code coverage. They're solveable but the choice isn't free.
- h1d 8y agoNote for --transpileOnly flag which speeds up compilation if you've already checked for typing errors in your editors and don't need to do it again on compilation. There's also ts-node-dev which is a variation of node-dev that auto reloads files loaded on change. As for a bundler, parcel supports TypeScript out of the box which just allows you to write browser side code with TS without effort.