ts-node

deno vs ts-node : what's the difference

会有一股神秘感。 提交于 2019-12-30 00:58:49
问题 I'm working on a relative large typescript project, I'm using ts-node to run node testing and examples. As far as I understand, ts-node will compile ts files to js files and execute. Recently I heard about deno , which is a typescript runtime. I tried a few examples in typescript, which works using ts-node . I ran the example with deno , there were many compile messages printed in the console, then execute the code. And later I found there's cache files in /username/.deno . I don't feel the

ts-node ignores d.ts files while tsc successfully compiles the project

懵懂的女人 提交于 2019-12-09 14:19:52
问题 Having compiled my TypeScript project successfully, I intended to run it in VS Code's debug mode using ts-node . Problem is, ts-node can't find d.ts files I created (while tsc has no problem with it). Project structure is: / conf/ dist/ src/ types/ package.json tsconfig.json tsconfig.json relevant entries are: { "compilerOptions": { "target": "es2017", "module": "commonjs", // "lib": [], "sourceMap": true, "outDir": "dist", "rootDir": "src", "moduleResolution": "node", "baseUrl": ".", "paths"

TypeScript ES dynamic `import()`

℡╲_俬逩灬. 提交于 2019-12-08 18:47:49
问题 While using the new TypeScript feature, so called ES Dynamic Imports, I am not able to run the code of my isomorphic app on the server side using ts-node . It seems like the error does not occur when using the webpack module loader which transpiles the code in it's own way and running resulting files in a browser. The error which I've got: case 0: return [4 /*yield*/, import("./component/main")]; ^^^^^^ SyntaxError: Unexpected token import Usually TypeScript transpiles the import expression

ts-node ignores d.ts files while tsc successfully compiles the project

只愿长相守 提交于 2019-12-03 23:36:13
Having compiled my TypeScript project successfully, I intended to run it in VS Code's debug mode using ts-node . Problem is, ts-node can't find d.ts files I created (while tsc has no problem with it). Project structure is: / conf/ dist/ src/ types/ package.json tsconfig.json tsconfig.json relevant entries are: { "compilerOptions": { "target": "es2017", "module": "commonjs", // "lib": [], "sourceMap": true, "outDir": "dist", "rootDir": "src", "moduleResolution": "node", "baseUrl": ".", "paths": { "*": [ "node_modules/*", "src/types/*" ] }, // "rootDirs": [], // "typeRoots": [], // "types": [],

Is there a way to use npm scripts to run tsc -watch && nodemon --watch?

不羁岁月 提交于 2019-11-29 22:56:58
I'm looking for a way to use npm scripts to run tsc --watch && nodemon --watch at the same time. I can run this commands independently, but when I want run both of them, only the first one is executed. eg. if I have this script: "scripts": { "runDeb": "set NODE_ENV=development&& tsc --watch && nodemon --watch" } tsc --watch is executed but nodemon is never called, and vice versa. I think what you want is something like this (my current setup): "scripts": { "compile": "tsc && node app.js", "dev": "./node_modules/nodemon/bin/nodemon.js -e ts --exec \"npm run compile\"" } I created two scripts

Is there a way to use npm scripts to run tsc -watch && nodemon --watch?

妖精的绣舞 提交于 2019-11-28 19:48:08
问题 I'm looking for a way to use npm scripts to run tsc --watch && nodemon --watch at the same time. I can run this commands independently, but when I want run both of them, only the first one is executed. eg. if I have this script: "scripts": { "runDeb": "set NODE_ENV=development&& tsc --watch && nodemon --watch" } tsc --watch is executed but nodemon is never called, and vice versa. 回答1: I think what you want is something like this (my current setup): "scripts": { "compile": "tsc && node app.js"