Skip to content

Commit c6a7ee2

Browse files
authored
docs: update type stripping default versions (#8157)
* docs: update type stripping default versions Signed-off-by: Hyunbin Seo <[email protected]> * docs: remove mention of eol 23.6 Signed-off-by: Hyunbin Seo <[email protected]> * docs: use latest-v22.x links Signed-off-by: Hyunbin Seo <[email protected]> --------- Signed-off-by: Hyunbin Seo <[email protected]>
1 parent 1338a29 commit c6a7ee2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/site/pages/en/learn/typescript/run-natively.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors: AugustinMauroy, khaosdoctor, jakebailey, robpalme
66

77
# Running TypeScript Natively
88

9-
Since v23.6.0, Node.js enables "type stripping" by default. If you are using v23.6.0 or later and your source code contains only [erasable typescript syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/#the---erasablesyntaxonly-option), you do not need this article.
9+
Since v22.18.0, Node.js enables "type stripping" by default. If you are using v22.18.0 or later and your source code contains only [erasable typescript syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/#the---erasablesyntaxonly-option), you do not need this article.
1010

1111
## Running TypeScript code with Node.js
1212

@@ -20,13 +20,13 @@ node --experimental-strip-types example.ts
2020

2121
And that's it! You can now run TypeScript code directly in Node.js without the need to transpile it first, and use TypeScript to catch type-related errors.
2222

23-
In V22.7.0 this experimental support was extended to transform TypeScript-only syntax, like `enum`s and `namespace`, with the addition of the [`--experimental-transform-types`](https://nodejs.org/docs/latest-v23.x/api/cli.html#--experimental-transform-types) flag. Enabling `--experimental-transform-types` automatically implies that `--experimental-strip-types` is enabled, so there's no need to use both flags in the same command:
23+
In V22.7.0 this experimental support was extended to transform TypeScript-only syntax, like `enum`s and `namespace`, with the addition of the [`--experimental-transform-types`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--experimental-transform-types) flag. Enabling `--experimental-transform-types` automatically implies that `--experimental-strip-types` is enabled, so there's no need to use both flags in the same command:
2424

2525
```bash
2626
node --experimental-transform-types another-example.ts
2727
```
2828

29-
From v23.6.0 onwards, type stripping is enabled by default (you can disable it via [`--no-experimental-strip-types`](https://nodejs.org/docs/latest-v23.x/api/cli.html#--no-experimental-strip-types)), enabling you to run any supported syntax, so running files like the one below with `node file.ts` is supported:
29+
From v22.18.0 onwards, type stripping is enabled by default (you can disable it via [`--no-experimental-strip-types`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--no-experimental-strip-types)), enabling you to run any supported syntax, so running files like the one below with `node file.ts` is supported:
3030

3131
```ts
3232
function foo(bar: number): string {
@@ -51,7 +51,7 @@ Future versions of Node.js will include support for TypeScript without the need
5151

5252
At the time of writing, the experimental support for TypeScript in Node.js has some limitations.
5353

54-
You can get more information on the [API docs](https://nodejs.org/docs/latest-v23.x/api/typescript.html#typescript-features).
54+
You can get more information on the [API docs](https://nodejs.org/docs/latest-v22.x/api/typescript.html#typescript-features).
5555

5656
### Configuration
5757

0 commit comments

Comments
 (0)