You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/configuration.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,9 @@ Hello, Ronald!
19
19
20
20
ts-node automatically finds and loads `tsconfig.json`. Most ts-node options can be specified in a `"ts-node"` object using their programmatic, camelCase names. We recommend this because it works even when you cannot pass CLI flags, such as `node --require ts-node/register` and when using shebangs.
21
21
22
-
Use `--skip-project` to skip loading the `tsconfig.json`. Use `--project` to explicitly specify the path to a `tsconfig.json`.
22
+
Use `--skipProject` to skip loading the `tsconfig.json`. Use `--project` to explicitly specify the path to a `tsconfig.json`.
23
23
24
-
When searching, it is resolved using [the same search behavior as `tsc`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). By default, this search is performed relative to the entrypoint script. In `--cwd-mode` or if no entrypoint is specified -- for example when using the REPL -- the search is performed relative to `--cwd` / `process.cwd()`.
24
+
When searching, it is resolved using [the same search behavior as `tsc`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). By default, this search is performed relative to the entrypoint script. In `--cwdMode` or if no entrypoint is specified -- for example when using the REPL -- the search is performed relative to `--cwd` / `process.cwd()`.
25
25
26
26
You can use this sample configuration as a starting point:
27
27
@@ -74,7 +74,7 @@ With the latest `node` and `typescript`, this is [`@tsconfig/node16`](https://gi
74
74
75
75
Older versions of `typescript` are incompatible with `@tsconfig/node16`. In those cases we will use an older default configuration.
76
76
77
-
When in doubt, `ts-node --show-config` will log the configuration being used, and `ts-node -vv` will log `node` and `typescript` versions.
77
+
When in doubt, `ts-node --showConfig` will log the configuration being used, and `ts-node -vv` will log `node` and `typescript` versions.
Copy file name to clipboardExpand all lines: website/docs/options.md
+15-13Lines changed: 15 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ title: Options
4
4
5
5
`ts-node` supports `--print` (`-p`), `--eval` (`-e`), `--require` (`-r`) and `--interactive` (`-i`) similar to the [node.js CLI options](https://nodejs.org/api/cli.html).
6
6
7
+
All command-line flags support both `--camelCase` and `--hyphen-case`.
8
+
7
9
_Environment variables, where available, are in `ALL_CAPS`_
8
10
9
11
## Shell
@@ -17,31 +19,31 @@ _Environment variables, where available, are in `ALL_CAPS`_
17
19
## TSConfig
18
20
19
21
-`-P, --project [path]` Path to TypeScript JSON project file <br/>*Environment:*`TS_NODE_PROJECT`
20
-
-`--skip-project` Skip project config resolution and loading <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_SKIP_PROJECT`
21
-
-`-c, --cwd-mode` Resolve config relative to the current directory instead of the directory of the entrypoint script
22
-
-`-O, --compiler-options [opts]` JSON object to merge with compiler options <br/>*Environment:*`TS_NODE_COMPILER_OPTIONS`
23
-
-`--show-config` Print resolved `tsconfig.json`, including `ts-node` options, and exit
22
+
-`--skipProject` Skip project config resolution and loading <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_SKIP_PROJECT`
23
+
-`-c, --cwdMode` Resolve config relative to the current directory instead of the directory of the entrypoint script
24
+
-`-O, --compilerOptions [opts]` JSON object to merge with compiler options <br/>*Environment:*`TS_NODE_COMPILER_OPTIONS`
25
+
-`--showConfig` Print resolved `tsconfig.json`, including `ts-node` options, and exit
24
26
25
27
## Typechecking
26
28
27
-
-`-T, --transpile-only` Use TypeScript's faster `transpileModule` <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_TRANSPILE_ONLY`
28
-
-`--type-check` Opposite of `--transpile-only` <br/>*Default:*`true`<br/>*Environment:*`TS_NODE_TYPE_CHECK`
29
-
-`-H, --compiler-host` Use TypeScript's compiler host API <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_COMPILER_HOST`
29
+
-`-T, --transpileOnly` Use TypeScript's faster `transpileModule` <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_TRANSPILE_ONLY`
30
+
-`--typeCheck` Opposite of `--transpileOnly` <br/>*Default:*`true`<br/>*Environment:*`TS_NODE_TYPE_CHECK`
31
+
-`-H, --compilerHost` Use TypeScript's compiler host API <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_COMPILER_HOST`
30
32
-`--files` Load `files`, `include` and `exclude` from `tsconfig.json` on startup <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_FILES`
31
-
-`-D, --ignore-diagnostics [code]` Ignore TypeScript warnings by diagnostic code <br/>*Environment:*`TS_NODE_IGNORE_DIAGNOSTICS`
33
+
-`-D, --ignoreDiagnostics [code]` Ignore TypeScript warnings by diagnostic code <br/>*Environment:*`TS_NODE_IGNORE_DIAGNOSTICS`
32
34
33
35
## Transpilation
34
36
35
37
-`-I, --ignore [pattern]` Override the path patterns to skip compilation <br/>*Default:*`/node_modules/` <br/>*Environment:*`TS_NODE_IGNORE`
-`-C, --compiler [name]` Specify a custom TypeScript compiler <br/>*Default:*`typescript` <br/>*Environment:*`TS_NODE_COMPILER`
38
-
-`--swc` Transpile with [swc](./transpilers.md#swc). Implies `--transpile-only` <br/>*Default:*`false`
40
+
-`--swc` Transpile with [swc](./transpilers.md#swc). Implies `--transpileOnly` <br/>*Default:*`false`
39
41
-`--transpiler [name]` Specify a third-party, non-typechecking transpiler
40
-
-`--prefer-ts-exts` Re-order file extensions so that TypeScript imports are preferred <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_PREFER_TS_EXTS`
42
+
-`--preferTsExts` Re-order file extensions so that TypeScript imports are preferred <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_PREFER_TS_EXTS`
41
43
42
44
## Diagnostics
43
45
44
-
-`--log-error` Logs TypeScript errors to stderr instead of throwing exceptions <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_LOG_ERROR`
46
+
-`--logError` Logs TypeScript errors to stderr instead of throwing exceptions <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_LOG_ERROR`
45
47
-`--pretty` Use pretty diagnostic formatter <br/>*Default:*`false` <br/>*Environment:*`TS_NODE_PRETTY`
46
48
-`TS_NODE_DEBUG` Enable debug logging<br/>
47
49
@@ -54,7 +56,7 @@ _Environment variables, where available, are in `ALL_CAPS`_
54
56
-`--scopeDir` Directory within which compiler is limited when `scope` is enabled. <br/>*Default:* First of: `tsconfig.json` "rootDir" if specified, directory containing `tsconfig.json`, or cwd if no `tsconfig.json` is loaded.<br/>*Environment:*`TS_NODE_SCOPE_DIR`
55
57
-`moduleType` Override the module type of certain files, ignoring the `package.json``"type"` field. See [Module type overrides](./module-type-overrides.md) for details.<br/>*Default:* obeys `package.json``"type"` and `tsconfig.json``"module"` <br/>*Can only be specified via `tsconfig.json` or API.*
56
58
-`TS_NODE_HISTORY` Path to history file for REPL <br/>*Default:*`~/.ts_node_repl_history`<br/>
57
-
-`--no-experimental-repl-await` Disable top-level await in REPL. Equivalent to node's [`--no-experimental-repl-await`](https://nodejs.org/api/cli.html#cli_no_experimental_repl_await)<br/>*Default:* Enabled if TypeScript version is 3.8 or higher and target is ES2018 or higher.<br/>*Environment:*`TS_NODE_EXPERIMENTAL_REPL_AWAIT` set `false` to disable
59
+
-`--noExperimentalReplAwait` Disable top-level await in REPL. Equivalent to node's [`--no-experimental-repl-await`](https://nodejs.org/api/cli.html#cli_no_experimental_repl_await)<br/>*Default:* Enabled if TypeScript version is 3.8 or higher and target is ES2018 or higher.<br/>*Environment:*`TS_NODE_EXPERIMENTAL_REPL_AWAIT` set `false` to disable
0 commit comments