Skip to content

Commit 137c2f7

Browse files
committed
Rename package name to "@esm.sh/cjs-module-lexer"
1 parent 2e2d11b commit 137c2f7

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# esm-cjs-lexer
1+
# @esm.sh/cjs-module-lexer
22

3-
A wasm module for detecting the `module.exports` of a CJS module, powered by [swc](https://github.com/swc-project/swc).
3+
A lexer for detecting the `module.exports` of a CJS module, written in Rust and compiled to WebAssembly.
44

55
## Usage
66

7-
esm-cjs-lexer currently only supports Node.js environment. You can install it via npm CLI:
7+
`@esm.sh/cjs-module-lexer` currently only supports Node.js environment. You can install it via npm CLI:
88

99
```bash
10-
npm i esm-cjs-lexer
10+
npm i @esm.sh/cjs-module-lexer
1111
```
1212

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.
13+
`@esm.sh/cjs-module-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.
1414

1515
```js
16-
const { parse } = require("esm-cjs-lexer");
16+
const { parse } = require("@esm.sh/cjs-module-lexer");
1717

1818
// named exports by assignment
1919
// exports: ["a", "b", "c", "__esModule", "foo"]

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@esm.sh/cjs-module-lexer",
3+
"description": "A WASM module to parse the `module.exports` of a commonjs module.",
4+
"version": "1.0.0",
5+
"main": "pkg/cjs_module_lexer.js",
6+
"types": "pkg/cjs_module_lexer.d.ts",
7+
"scripts": {
8+
"prepublishOnly": "wasm-pack build --target nodejs"
9+
},
10+
"files": [
11+
"pkg/cjs_module_lexer_bg.wasm",
12+
"pkg/cjs_module_lexer.js",
13+
"pkg/cjs_module_lexer.d.ts"
14+
],
15+
"repository": {
16+
"type": "git",
17+
"url": "https://github.com/esm-dev/esm-cjs-lexer"
18+
},
19+
"license": "MIT"
20+
}

0 commit comments

Comments
 (0)