5 ms·
Frustrating, though, that there's no good repl for TypeScript.
by kbd 7y ago
Frustrating, though, that there's no good repl for TypeScript.
- JoBrad 7y agoI've used ts-node, with pretty good results. https://www.npmjs.com/package/ts-node https://www.npmjs.com/package/ts-node
- breck 7y agoTs-Node is great. Startup times are slow though. 30x slower. Example for same script using node vs tsnode: "user 0.11s" "user 0m2.839s". Am I doing something dumb?
- swsieber 7y agoDumb? No, incorrectly maybe though. Ts-node has to scan files for types upon startup - there are various knobs to control this I think. Mu bet is that it's the culprit.
- kbd 7y agoTs-node is honestly pretty terrible. By-default you need to disable some errors that make sense in code but not in a repl. "You just imported this thing but didn't use it yet, ERROR", which means that nobody uses the thing. Granted, I'm pretty spoiled by how excellent ipython is, but clearly no one actually uses ts-node. It doesn't even remember history between sessions, and they have no interest in making that work, even deferring to rlwrap.
- breck 7y agoInteresting. I haven’t used it as a repl. Just for running ts scripts directly so I don’t have to do a 2 step compile/execute.