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
+32-35Lines changed: 32 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,26 @@
1
1
# esm-cjs-lexer
2
2
3
-
A **WASM** module to parse the `module.exports` of a commonjs module, powered by [swc](https://github.com/swc-project/swc).
3
+
A commonjs module lexer written in Rust for detecting the `module.exports` of a commonjs module. The lexer is powered by [swc](https://github.com/swc-project/swc), compiled to WebAssembly.
4
4
5
-
## Installation
5
+
## Usage
6
6
7
-
esm-cjs-lexer only supports node.js environment currently. You can install it via `npm`:
7
+
esm-cjs-lexer currently only supports Node.js environment. You can install it via npm CLI:
8
8
9
9
```bash
10
10
npm i esm-cjs-lexer
11
11
```
12
12
13
-
## Usage
14
-
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.
13
+
esm-cjs-lexer provides a `parse` function that detects the `module.exports` of a commonjs module. 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