Skip to content

Commit

Permalink
update esm messaging in docs (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Sep 12, 2021
1 parent 405295e commit 9cf6ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions website/docs/imports.md
Expand Up @@ -2,7 +2,7 @@
title: "CommonJS vs native ECMAScript modules"
---

TypeScript is almost always written using modern `import` syntax, but you can choose to either transform to CommonJS or use node's native ESM support. Configuration is different for each.
TypeScript is almost always written using modern `import` syntax, but it is also transformed before being executed by the underlying runtime. You can choose to either transform to CommonJS or to preserve the native `import` syntax, using node's native ESM support. Configuration is different for each.

Here is a brief comparison of the two.

Expand Down Expand Up @@ -49,8 +49,7 @@ If you must keep `"module": "ESNext"` for `tsc`, webpack, or another build tool,

## Native ECMAScript modules

[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 also experimental. They may have
breaking changes in minor and patch releases and are not recommended for production.
[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.

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

Expand Down
6 changes: 1 addition & 5 deletions website/readme-sources/prefix.md
Expand Up @@ -21,12 +21,8 @@ You can build the readme with this command:
[![Build status](https://img.shields.io/github/workflow/status/TypeStrong/ts-node/Continuous%20Integration)](https://github.com/TypeStrong/ts-node/actions?query=workflow%3A%22Continuous+Integration%22)
[![Test coverage](https://codecov.io/gh/TypeStrong/ts-node/branch/main/graph/badge.svg)](https://codecov.io/gh/TypeStrong/ts-node)

> TypeScript execution and REPL for node.js, with source map support. **Works with `typescript@>=2.7`**.
> TypeScript execution and REPL for node.js, with source map and native ESM support.
The latest documentation can also be found on our website: [https://typestrong.org/ts-node](https://typestrong.org/ts-node)

### *Experimental ESM support*

Native ESM support is currently experimental. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007).

# Table of Contents

0 comments on commit 9cf6ae3

Please sign in to comment.