From 4416b0df9d8de4180168f49d44ae92898982159c Mon Sep 17 00:00:00 2001 From: SpiderMath <71999854+SpiderMath@users.noreply.github.com> Date: Wed, 12 May 2021 22:36:54 +0530 Subject: [PATCH] ts-node: add page (#5911) --- pages/common/ts-node.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/ts-node.md diff --git a/pages/common/ts-node.md b/pages/common/ts-node.md new file mode 100644 index 0000000000..0b58426c90 --- /dev/null +++ b/pages/common/ts-node.md @@ -0,0 +1,28 @@ +# ts-node + +> Run TypeScript code directly, without any compiling. +> More information: . + +- Execute a TypeScript file without compiling (`node` + `tsc`): + +`ts-node {{path/to/file.ts}}` + +- Execute a TypeScript file without loading `tsconfig.json`: + +`ts-node --skip-project {{path/to/file.ts}}` + +- Evaluate TypeScript code passed as a literal on the command-line: + +`ts-node --eval '{{console.log("Hello World")}}'` + +- Execute a TypeScript file in script mode: + +`ts-node --script-mode {{path/to/file.ts}}` + +- Transpile a TypeScript file to JavaScript without executing it: + +`ts-node --transpile-only {{path/to/file.ts}}` + +- Display TS-Node help: + +`ts-node --help`