Skip to content

Commit b7162ab

Browse files
animafpscspotcode
andauthored
changed all references to ts-node consistent (#1481)
* changed all references to ts-node consistent * Pesky maintainer-prerogative nitpicks Co-authored-by: Andrew Bradley <[email protected]>
1 parent f421f60 commit b7162ab

11 files changed

+30
-30
lines changed

website/docs/configuration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: Configuration
33
---
44

5-
`ts-node` supports a variety of options which can be specified via `tsconfig.json`, as CLI flags, as environment variables, or programmatically.
5+
ts-node supports a variety of options which can be specified via `tsconfig.json`, as CLI flags, as environment variables, or programmatically.
66

77
For a complete list, see [Options](./options.md).
88

99
## CLI flags
1010

11-
`ts-node` CLI flags must come *before* the entrypoint script. For example:
11+
ts-node CLI flags must come *before* the entrypoint script. For example:
1212

1313
```shell
1414
$ ts-node --project tsconfig-dev.json say-hello.ts Ronald
@@ -17,7 +17,7 @@ Hello, Ronald!
1717

1818
## Via tsconfig.json (recommended)
1919

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.
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.
2121

2222
Use `--skip-project` to skip loading the `tsconfig.json`. Use `--project` to explicitly specify the path to a `tsconfig.json`.
2323

@@ -55,7 +55,7 @@ Our bundled [JSON schema](https://unpkg.com/browse/ts-node@latest/tsconfig.schem
5555
### @tsconfig/bases
5656

5757
[@tsconfig/bases](https://github.com/tsconfig/bases) maintains recommended configurations for several node versions.
58-
As a convenience, these are bundled with `ts-node`.
58+
As a convenience, these are bundled with ts-node.
5959

6060
```json title="tsconfig.json"
6161
{
@@ -68,7 +68,7 @@ As a convenience, these are bundled with `ts-node`.
6868

6969
### Default config
7070

71-
If no `tsconfig.json` is loaded from disk, `ts-node` will use the newest recommended defaults from
71+
If no `tsconfig.json` is loaded from disk, ts-node will use the newest recommended defaults from
7272
[@tsconfig/bases](https://github.com/tsconfig/bases/) compatible with your `node` and `typescript` versions.
7373
With the latest `node` and `typescript`, this is [`@tsconfig/node16`](https://github.com/tsconfig/bases/blob/master/bases/node16.json).
7474

@@ -78,15 +78,15 @@ When in doubt, `ts-node --show-config` will log the configuration being used, an
7878

7979
## `node` flags
8080

81-
[`node` flags](https://nodejs.org/api/cli.html) must be passed directly to `node`; they cannot be passed to the `ts-node` binary nor can they be specified in `tsconfig.json`
81+
[`node` flags](https://nodejs.org/api/cli.html) must be passed directly to `node`; they cannot be passed to the ts-node binary nor can they be specified in `tsconfig.json`
8282

8383
We recommend using the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#cli_node_options_options) environment variable to pass options to `node`.
8484

8585
```shell
8686
NODE_OPTIONS='--trace-deprecation --abort-on-uncaught-exception' ts-node ./index.ts
8787
```
8888

89-
Alternatively, you can invoke `node` directly and install `ts-node` via `--require`/`-r`
89+
Alternatively, you can invoke `node` directly and install ts-node via `--require`/`-r`
9090

9191
```shell
9292
node --trace-deprecation --abort-on-uncaught-exception -r ts-node/register ./index.ts

website/docs/how-it-works.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: How It Works
33
---
44

5-
`ts-node` works by registering hooks for `.ts`, `.tsx`, `.js`, and/or `.jsx` extensions.
5+
ts-node works by registering hooks for `.ts`, `.tsx`, `.js`, and/or `.jsx` extensions.
66

77
Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook runs in the middle, transforming code from TypeScript to JavaScript and passing the result to `node` for execution. This transformation will respect your `tsconfig.json` as if you had compiled via `tsc`.
88

@@ -12,7 +12,7 @@ Vanilla `node` loads `.js` by reading code from disk and executing it. Our hook
1212

1313
> **Warning:** if a file is ignored or its file extension is not registered, node will either fail to resolve the file or will attempt to execute it as JavaScript without any transformation. This may cause syntax errors or other failures, because node does not understand TypeScript type syntax nor bleeding-edge ECMAScript features.
1414
15-
> **Warning:** When `ts-node` is used with `allowJs`, all non-ignored JavaScript files are transformed using the TypeScript compiler.
15+
> **Warning:** When ts-node is used with `allowJs`, all non-ignored JavaScript files are transformed using the TypeScript compiler.
1616
1717
## Skipping `node_modules`
1818

website/docs/imports.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Here is a brief comparison of the two.
1111
| Write native `import` syntax | Write native `import` syntax |
1212
| Transforms `import` into `require()` | Does not transform `import` |
1313
| Node executes scripts using the classic [CommonJS loader](https://nodejs.org/dist/latest-v16.x/docs/api/modules.html) | Node executes scripts using the new [ESM loader](https://nodejs.org/dist/latest-v16.x/docs/api/esm.html) |
14-
| Use any of:<br/>`ts-node` CLI<br/>`node -r ts-node/register`<br/>`NODE_OPTIONS="ts-node/register" node`<br/>`require('ts-node').register({/* options */})` | Must use the ESM loader via:<br/>`node --loader ts-node/esm`<br/>`NODE_OPTIONS="--loader ts-node/esm" node` |
14+
| Use any of:<br/>ts-node CLI<br/>`node -r ts-node/register`<br/>`NODE_OPTIONS="ts-node/register" node`<br/>`require('ts-node').register({/* options */})` | Must use the ESM loader via:<br/>`node --loader ts-node/esm`<br/>`NODE_OPTIONS="--loader ts-node/esm" node` |
1515

1616
## CommonJS
1717

@@ -32,7 +32,7 @@ Transforming to CommonJS is typically simpler and more widely supported because
3232
}
3333
```
3434

35-
If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool, you can set an override for `ts-node`.
35+
If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool, you can set an override for ts-node.
3636

3737
```json title="tsconfig.json"
3838
{
@@ -49,7 +49,7 @@ If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool,
4949

5050
## Native ECMAScript modules
5151

52-
[Node's ESM loader hooks](https://nodejs.org/api/esm.html#esm_experimental_loaders) are [**experimental**](https://nodejs.org/api/documentation.html#documentation_stability_index) and subject to change. `ts-node`'s ESM support is as stable as possible, but it relies on APIs which node can *and will* break in new versions of node. Thus it is not recommended for production.
52+
[Node's ESM loader hooks](https://nodejs.org/api/esm.html#esm_experimental_loaders) are [**experimental**](https://nodejs.org/api/documentation.html#documentation_stability_index) and subject to change. ts-node's ESM support is as stable as possible, but it relies on APIs which node can *and will* break in new versions of node. Thus it is not recommended for production.
5353

5454
For complete usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007).
5555

website/docs/module-type-overrides.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Module type overrides
33
---
44

5-
When deciding between CommonJS and native ECMAScript modules, `ts-node` defaults to matching vanilla `node` and `tsc`
5+
When deciding between CommonJS and native ECMAScript modules, ts-node defaults to matching vanilla `node` and `tsc`
66
behavior. This means TypeScript files are transformed according to your `tsconfig.json` `"module"` option and executed
77
according to node's rules for the `package.json` `"type"` field.
88

@@ -15,7 +15,7 @@ In these situations, our `moduleTypes` option lets you override certain files, f
1515
CommonJS or ESM. Node supports similar overriding via `.cjs` and `.mjs` file extensions, but `.ts` files cannot use them.
1616
`moduleTypes` achieves the same effect, and *also* overrides your `tsconfig.json` `"module"` config appropriately.
1717

18-
The following example tells `ts-node` to execute a webpack config as CommonJS:
18+
The following example tells ts-node to execute a webpack config as CommonJS:
1919

2020
```json title=tsconfig.json
2121
{

website/docs/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Overview
33
slug: /
44
---
55

6-
`ts-node` is a TypeScript execution engine and REPL for Node.js.
6+
ts-node is a TypeScript execution engine and REPL for Node.js.
77

88
It JIT transforms TypeScript into JavaScript, enabling you to directly execute TypeScript on Node.js without precompiling.
99
This is accomplished by hooking node's module loading APIs, enabling it to be used seamlessly alongside other Node.js

website/docs/paths.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: |
33
paths and baseUrl
44
---
55

6-
You can use `ts-node` together with [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) to load modules according to the `paths` section in `tsconfig.json`.
6+
You can use ts-node together with [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) to load modules according to the `paths` section in `tsconfig.json`.
77

88
```json title="tsconfig.json"
99
{
@@ -14,7 +14,7 @@ You can use `ts-node` together with [tsconfig-paths](https://www.npmjs.com/packa
1414
}
1515
```
1616

17-
## Why is this not built-in to `ts-node`?
17+
## Why is this not built-in to ts-node?
1818

1919
The official TypeScript Handbook explains the intended purpose for `"paths"` in ["Additional module resolution flags"](https://www.typescriptlang.org/docs/handbook/module-resolution.html#additional-module-resolution-flags).
2020

@@ -23,4 +23,4 @@ The official TypeScript Handbook explains the intended purpose for `"paths"` in
2323
> It is important to note that the compiler will not perform any of these transformations; it just uses these pieces of information to guide the process of resolving a module import to its definition file.
2424
2525
This means `"paths"` are intended to describe mappings that the build tool or runtime *already* performs, not to tell the build tool or
26-
runtime how to resolve modules. In other words, they intend us to write our imports in a way `node` already understands. For this reason, `ts-node` does not modify `node`'s module resolution behavior to implement `"paths"` mappings.
26+
runtime how to resolve modules. In other words, they intend us to write our imports in a way `node` already understands. For this reason, ts-node does not modify `node`'s module resolution behavior to implement `"paths"` mappings.

website/docs/performance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
title: Make it fast
33
---
44

5-
These tricks will make `ts-node` faster.
5+
These tricks will make ts-node faster.
66

77
## Skip typechecking
88

9-
It is often better to use `tsc --noEmit` to typecheck once before your tests run or as a lint step. In these cases, `ts-node` can skip typechecking.
9+
It is often better to use `tsc --noEmit` to typecheck once before your tests run or as a lint step. In these cases, ts-node can skip typechecking.
1010

1111
* Enable [`transpileOnly`](./options.md) to skip typechecking
1212
* Use our [`swc` integration](./transpilers.md#bundled-swc-integration)

website/docs/transpilers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Third-party transpilers
44

55
In transpile-only mode, we skip typechecking to speed up execution time. You can go a step further and use a
66
third-party transpiler to transform TypeScript into JavaScript even faster. You will still benefit from
7-
`ts-node`'s automatic `tsconfig.json` discovery, sourcemap support, and global `ts-node` CLI. Integrations
7+
ts-node's automatic `tsconfig.json` discovery, sourcemap support, and global ts-node CLI. Integrations
88
can automatically derive an appropriate configuration from your existing `tsconfig.json` which simplifies project
99
boilerplate.
1010

website/docs/troubleshooting.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: Troubleshooting
44

55
## Understanding configuration
66

7-
`ts-node` uses sensible default configurations to reduce boilerplate while still respecting `tsconfig.json` if you
7+
ts-node uses sensible default configurations to reduce boilerplate while still respecting `tsconfig.json` if you
88
have one. If you are unsure which configuration is used, you can log it with `ts-node --show-config`. This is similar to
99
`tsc --showConfig` but includes `"ts-node"` options as well.
1010

11-
`ts-node` also respects your locally-installed `typescript` version, but global installations fallback to the globally-installed
11+
ts-node also respects your locally-installed `typescript` version, but global installations fallback to the globally-installed
1212
`typescript`. If you are unsure which versions are used, `ts-node -vv` will log them.
1313

1414
```shell
@@ -54,15 +54,15 @@ $ ts-node --show-config
5454

5555
## Understanding Errors
5656

57-
It is important to differentiate between errors from `ts-node`, errors from the TypeScript compiler, and errors from `node`. It is also important to understand when errors are caused by a type error in your code, a bug in your code, or a flaw in your configuration.
57+
It is important to differentiate between errors from ts-node, errors from the TypeScript compiler, and errors from `node`. It is also important to understand when errors are caused by a type error in your code, a bug in your code, or a flaw in your configuration.
5858

5959
### `TSError`
6060

6161
Type errors from the compiler are thrown as a `TSError`. These are the same as errors you get from `tsc`.
6262

6363
### `SyntaxError`
6464

65-
Any error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cannot be fixed by TypeScript or `ts-node`. These are bugs in your code or configuration.
65+
Any error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cannot be fixed by TypeScript or ts-node. These are bugs in your code or configuration.
6666

6767
#### Unsupported JavaScript syntax
6868

website/docs/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Help! My Types Are Missing!"
33
---
44

5-
**TypeScript Node** does _not_ use `files`, `include` or `exclude`, by default. This is because a large majority projects do not use all of the files in a project directory (e.g. `Gulpfile.ts`, runtime vs tests) and parsing every file for types slows startup time. Instead, `ts-node` starts with the script file (e.g. `ts-node index.ts`) and TypeScript resolves dependencies based on imports and references.
5+
ts-node does _not_ use `files`, `include` or `exclude`, by default. This is because a large majority projects do not use all of the files in a project directory (e.g. `Gulpfile.ts`, runtime vs tests) and parsing every file for types slows startup time. Instead, ts-node starts with the script file (e.g. `ts-node index.ts`) and TypeScript resolves dependencies based on imports and references.
66

77
For global definitions, you can use the `typeRoots` compiler option. This requires that your type definitions be structured as type packages (not loose TypeScript definition files). More details on how this works can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types).
88

website/docs/usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ Passing CLI arguments via shebang is allowed on Mac but not Linux. For example,
4242
// This shebang is not portable. It only works on Mac
4343
```
4444

45-
Instead, specify all `ts-node` options in your `tsconfig.json`.
45+
Instead, specify all ts-node options in your `tsconfig.json`.
4646

4747
## Programmatic
4848

49-
You can require `ts-node` and register the loader for future requires by using `require('ts-node').register({ /* options */ })`. You can also use file shortcuts - `node -r ts-node/register` or `node -r ts-node/register/transpile-only` - depending on your preferences.
49+
You can require ts-node and register the loader for future requires by using `require('ts-node').register({ /* options */ })`. You can also use file shortcuts - `node -r ts-node/register` or `node -r ts-node/register/transpile-only` - depending on your preferences.
5050

51-
**Note:** If you need to use advanced node.js CLI arguments (e.g. `--inspect`), use them with `node -r ts-node/register` instead of the `ts-node` CLI.
51+
**Note:** If you need to use advanced node.js CLI arguments (e.g. `--inspect`), use them with `node -r ts-node/register` instead of ts-node's CLI.
5252

5353
### Developers
5454

55-
`ts-node` exports a `create()` function that can be used to initialize a TypeScript compiler that isn't registered to `require.extensions`, and it uses the same code as `register`.
55+
ts-node exports a `create()` function that can be used to initialize a TypeScript compiler that isn't registered to `require.extensions`, and it uses the same code as `register`.

0 commit comments

Comments
 (0)