mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-09-20 08:17:53 +03:00
ts-node: add page (#5911)
This commit is contained in:
parent
145ae4905e
commit
4416b0df9d
28
pages/common/ts-node.md
Normal file
28
pages/common/ts-node.md
Normal file
@ -0,0 +1,28 @@
|
||||
# ts-node
|
||||
|
||||
> Run TypeScript code directly, without any compiling.
|
||||
> More information: <https://www.npmjs.com/package/ts-node>.
|
||||
|
||||
- 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`
|
Loading…
Reference in New Issue
Block a user