@herb-tools/node-wasm 0.8.10 → 0.9.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/build/libherb.js +0 -0
- package/dist/herb-node-wasm.cjs +22352 -410
- package/dist/herb-node-wasm.cjs.map +1 -1
- package/dist/herb-node-wasm.esm.js +22278 -409
- package/dist/herb-node-wasm.esm.js.map +1 -1
- package/dist/types/wasm-backend.d.ts +3 -1
- package/package.json +2 -2
- package/src/wasm-backend.ts +11 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { HerbBackend } from "@herb-tools/core";
|
|
1
|
+
import { HerbBackend, LexResult, ParseResult } from "@herb-tools/core";
|
|
2
2
|
export declare class HerbBackendNodeWASM extends HerbBackend {
|
|
3
|
+
lexFile(path: string): LexResult;
|
|
4
|
+
parseFile(path: string): ParseResult;
|
|
3
5
|
backendVersion(): string;
|
|
4
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herb-tools/node-wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "WebAssembly-based HTML-aware ERB parser for Node.js.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@herb-tools/core": "0.
|
|
39
|
+
"@herb-tools/core": "0.9.0"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"package.json",
|
package/src/wasm-backend.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs"
|
|
2
|
+
|
|
1
3
|
import { name, version } from "../package.json"
|
|
2
4
|
|
|
3
|
-
import { HerbBackend } from "@herb-tools/core"
|
|
5
|
+
import { HerbBackend, LexResult, ParseResult } from "@herb-tools/core"
|
|
4
6
|
|
|
5
7
|
export class HerbBackendNodeWASM extends HerbBackend {
|
|
8
|
+
lexFile(path: string): LexResult {
|
|
9
|
+
return this.lex(readFileSync(path, "utf-8"))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
parseFile(path: string): ParseResult {
|
|
13
|
+
return this.parse(readFileSync(path, "utf-8"))
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
backendVersion(): string {
|
|
7
17
|
return `${name}@${version}`
|
|
8
18
|
}
|