What does HackerNews think of ts-node?

TypeScript execution and REPL for node.js

Language: TypeScript

#93 in Hacktoberfest
#30 in Node.js
#6 in PHP
#27 in TypeScript
I thought this was going to be a project like ts-node [1]

[1] https://github.com/TypeStrong/ts-node

I’m guessing what’s documented here:

https://www.typescriptlang.org/docs/handbook/jsdoc-supported...

I’ve never written TypeScript myself so just a guess.

There’s also this for node.js:

https://github.com/TypeStrong/ts-node

If you are working on the server side, ts-node has been a huge timesaver. It removes the extra step of compiling and lets you just run your script with `ts-node script.ts` or even `#!/usr/bin/env ts-node` at the top of your file works.

https://github.com/TypeStrong/ts-node

> there's no really good simple way to say "Node: compile and execute this typescript file, please don't save the output on disk anywhere, or try to read tsconfig.json or package.json or whatever".

I guess there's no native typescript support for nodejs (so npx is out). Maybe deno can help?

https://deno.land/

> Supports TypeScript out of the box.

Thats clearly a sort of "now you have two problems" type solution - but if there's a desire to stick with ts as a language - it might be helpful? (to drop the python dependency).

Ed: hm, there's apparently ts-node : https://github.com/TypeStrong/ts-node

  npx ts-node script.ts
https://stackoverflow.com/a/33536053
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

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

> I have written tests in TypeScript, compiled to JavaScript, and then used Mocha, for example, to run tests. I would like to hear your thoughts on this.

We use ts-node to run our mocha tests without ever compiling: https://github.com/TypeStrong/ts-node