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: README.md
+36-36Lines changed: 36 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
1
# esm-cjs-lexer
2
2
3
-
A **WASM** module to parse the `module.exports` of a commonjs module for **ESM** converting, powered by [swc](https://github.com/swc-project/swc).
3
+
A **WASM** module to parse the `module.exports` of a commonjs module, powered by [swc](https://github.com/swc-project/swc).
4
4
5
5
## Installation
6
6
7
-
[esm-cjs-lexer](https://npmjs.org/esm-cjs-lexer) is a npm package and can be installed with:
7
+
esm-cjs-lexer only supports node.js environment currently. You can install it via `npm`:
8
8
9
9
```bash
10
10
npm i esm-cjs-lexer
11
11
```
12
12
13
13
## Usage
14
14
15
-
[esm-cjs-lexer](https://npmjs.org/esm-cjs-lexer) provides a `parse` function to parse the `module.exports` of a commonjs module. It returns an object with `exports` and `reexports` fields. For example:
15
+
esm-cjs-lexer provides a `parse` function that lookups the `module.exports` of a commonjs module by parsing the given code. The function returns an object with two properties: `exports` and `reexports`. The `exports` property is an array of the exported names, and the `reexports` property is an array of the reexported modules.
0 commit comments