esm-sync 3.3.4 → 3.3.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/esm/loader.js +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
# esm-sync
|
|
2
2
|
|
|
3
|
-
**This is a
|
|
3
|
+
**This is a fork of [esm](https://github.com/standard-things/esm)**: the brilliantly simple, babel-less, bundle-less ECMAScript module loader (which is now unmaintained).
|
|
4
|
+
|
|
5
|
+
This fork includes:
|
|
4
6
|
|
|
5
7
|
* Assorted updates from [@httptoolkit/esm](https://github.com/httptoolkit/esm) and [esm-wallaby fork](https://www.npmjs.com/package/esm-wallaby), adding support for ES modules containing new ES syntax, supporting modern Node versions (at least up to v22), and supporting `node:*` imports.
|
|
6
8
|
* Support for modules that use the `const require = createRequire(...)` pattern (or declare any other global `require` variable) which are otherwise unusable with `esm`.
|
|
7
9
|
* Support for modules that use only an `exports` map in their package.json, without a `main` field, which are otherwise unresolvable (reporting "Cannot find module", even though `import()` works correctly).
|
|
8
10
|
* Built-in types for use in TypeScript projects
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
This package is maintained for use in the [import-sync](https://github.com/nktnet1/import-sync) project.
|
|
13
|
+
|
|
14
|
+
You may also be interested in [jiti](https://github.com/unjs/jiti), which provides legacy (deprecated, but still reliable) support for synchronous imports.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
12
17
|
|
|
13
18
|
```sh
|
|
14
19
|
npm install esm-sync
|
|
15
20
|
```
|
|
16
21
|
|
|
17
|
-
Getting started
|
|
18
|
-
---
|
|
22
|
+
## Getting started
|
|
19
23
|
|
|
20
24
|
There are two ways to enable `esm-sync`.
|
|
21
25
|
|
|
@@ -42,8 +46,7 @@ There are two ways to enable `esm-sync`.
|
|
|
42
46
|
```
|
|
43
47
|
:bulb: Omit the filename to enable `esm-sync` in the REPL.
|
|
44
48
|
|
|
45
|
-
Features
|
|
46
|
-
---
|
|
49
|
+
## Features
|
|
47
50
|
|
|
48
51
|
:clap: By default, :100: percent CJS interoperability is enabled so you can get stuff done.<br>
|
|
49
52
|
:lock: `.mjs` files are limited to basic functionality without support for `esm-sync` options.
|
|
@@ -59,8 +62,7 @@ Out of the box `esm-sync` just works, no configuration necessary, and supports:
|
|
|
59
62
|
* Node `stdin`, [`--eval`](https://nodejs.org/api/cli.html#cli_e_eval_script), [`--print`](https://nodejs.org/api/cli.html#cli_p_print_script) flags
|
|
60
63
|
* Node [`--check`](https://nodejs.org/api/cli.html#cli_c_check) flag _(Node 10+)_
|
|
61
64
|
|
|
62
|
-
Options
|
|
63
|
-
---
|
|
65
|
+
## Options
|
|
64
66
|
|
|
65
67
|
Specify options with one of the following:
|
|
66
68
|
|