open-l2encdec 0.0.1 → 0.0.2
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 +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@ TypeScript and JavaScript bindings for the open-l2encdec WASM module. This packa
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install open-l2encdec
|
|
9
9
|
# or
|
|
10
|
-
yarn add
|
|
10
|
+
yarn add open-l2encdec
|
|
11
11
|
# or
|
|
12
|
-
pnpm add
|
|
12
|
+
pnpm add open-l2encdec
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
@@ -17,7 +17,7 @@ pnpm add @open-l2encdec/typescript
|
|
|
17
17
|
### TypeScript / ES Modules
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { initL2EncDec, encode, decode, initParams } from '
|
|
20
|
+
import { initL2EncDec, encode, decode, initParams } from 'open-l2encdec';
|
|
21
21
|
|
|
22
22
|
// Initialize the module
|
|
23
23
|
const module = await initL2EncDec();
|
|
@@ -34,7 +34,7 @@ const decoded = await decode(encoded, params, module);
|
|
|
34
34
|
### JavaScript / CommonJS
|
|
35
35
|
|
|
36
36
|
```javascript
|
|
37
|
-
const { initL2EncDec, encode, decode, initParams } = require('
|
|
37
|
+
const { initL2EncDec, encode, decode, initParams } = require('open-l2encdec');
|
|
38
38
|
|
|
39
39
|
(async () => {
|
|
40
40
|
const module = await initL2EncDec();
|
|
@@ -50,7 +50,7 @@ const { initL2EncDec, encode, decode, initParams } = require('@open-l2encdec/typ
|
|
|
50
50
|
You can also access the WASM module directly:
|
|
51
51
|
|
|
52
52
|
```typescript
|
|
53
|
-
import createModule from '
|
|
53
|
+
import createModule from 'open-l2encdec/wasm';
|
|
54
54
|
|
|
55
55
|
const module = await createModule();
|
|
56
56
|
const params = new module.Params();
|
|
@@ -106,10 +106,10 @@ import type {
|
|
|
106
106
|
Type,
|
|
107
107
|
EncodeResult,
|
|
108
108
|
DecodeResult
|
|
109
|
-
} from '
|
|
109
|
+
} from 'open-l2encdec';
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
The generated `interface.d.ts` from Emscripten is also available at
|
|
112
|
+
The generated `interface.d.ts` from Emscripten is also available at `open-l2encdec/wasm` for direct WASM module type access.
|
|
113
113
|
|
|
114
114
|
## Development
|
|
115
115
|
|