mausmark 0.2.0 → 0.2.1
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 +26 -3
- package/dist/mausmark.wasm +0 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -4,6 +4,9 @@ A fast, renderer-agnostic Markdown parser.
|
|
|
4
4
|
|
|
5
5
|
It aims to support and extend Markdown.
|
|
6
6
|
It is also practical, so it parses CommonMark too.
|
|
7
|
+
Distributed as a WASM build.
|
|
8
|
+
|
|
9
|
+
Project page and demo: https://myshkin.eu/mausmark
|
|
7
10
|
|
|
8
11
|
> Pre-1.0: minor versions may change the API.
|
|
9
12
|
|
|
@@ -154,9 +157,31 @@ Things to decide when building a richer renderer:
|
|
|
154
157
|
Escape output for your target format and apply an explicit policy
|
|
155
158
|
for untrusted input.
|
|
156
159
|
|
|
160
|
+
## Performance
|
|
161
|
+
|
|
162
|
+
The SIMD WebAssembly parser build is **75.3 KB**, uncompressed, or **25 KB with
|
|
163
|
+
Brotli** (quality 11, offline precompression). Source-to-AST measurements on
|
|
164
|
+
an Apple M3 Pro, Node.js 26.3.1 and Bun 1.4.2, compiled with Clang 22.1.7 at
|
|
165
|
+
`-Os` with LTO:
|
|
166
|
+
|
|
167
|
+
| Input | Node (µs) | Bun (µs) | Node (GB/s) | Bun (GB/s) |
|
|
168
|
+
| ---------------------- | --------: | -------: | ----------: | ---------: |
|
|
169
|
+
| Moby-Dick (1.2 MB) | ~303 | ~255 | ~4.0 | ~4.7 |
|
|
170
|
+
| Line-wrapped Moby-Dick | ~414 | ~291 | ~2.9 | ~4.1 |
|
|
171
|
+
| Pro Git chapters | 36.5 | 30.7 | 1.53 | 1.82 |
|
|
172
|
+
| tldr pages | 1.7 | 1.5 | 0.33 | 0.37 |
|
|
173
|
+
|
|
174
|
+
These are warmed parser-export timings with preloaded UTF-8 input and a reused
|
|
175
|
+
arena, including JavaScript iteration and export-call overhead. They exclude
|
|
176
|
+
initialization, input encoding/copying, AST snapshot copying, and rendering;
|
|
177
|
+
they are not end-to-end timings of the package’s `parse()` method. The last row
|
|
178
|
+
(tldr) reports average time per document; figures are medians across three
|
|
179
|
+
alternating passes, each with five timing samples. Pro Git uses Markdown, tldr
|
|
180
|
+
uses CommonMark; Moby-Dick rounds the close results from both dialects. GB/s
|
|
181
|
+
uses decimal bytes.
|
|
182
|
+
|
|
157
183
|
## Notes
|
|
158
184
|
|
|
159
|
-
- ESM-only.
|
|
160
185
|
- Node.js 22.14+ or a modern browser with WebAssembly SIMD.
|
|
161
186
|
- Browser bundlers must emit the package-relative `.wasm` asset.
|
|
162
187
|
- Input is limited to 64 MiB; parser arena growth is limited to 512
|
|
@@ -174,8 +199,6 @@ precompiled WebAssembly, and the renderer example. The implementation
|
|
|
174
199
|
source is currently private; the distributed package is licensed under
|
|
175
200
|
MIT.
|
|
176
201
|
|
|
177
|
-
Project page and demo: https://myshkin.eu/mausmark
|
|
178
|
-
|
|
179
202
|
## License
|
|
180
203
|
|
|
181
204
|
MIT. See [LICENSE](LICENSE).
|
package/dist/mausmark.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mausmark",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A fast, dependency-free Markdown parser compiled to WebAssembly",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
"build:wasm": "./build.sh wasm-core",
|
|
23
23
|
"build:js": "./build.sh codegen && tsc -p tsconfig.json",
|
|
24
24
|
"build": "npm run clean && npm run build:wasm && npm run build:js",
|
|
25
|
-
"
|
|
25
|
+
"check:wasm-size": "node test/wasm_size.mjs",
|
|
26
|
+
"test:package": "node --test test/npm-package.test.mjs test/wasm-size.test.mjs",
|
|
26
27
|
"test:types": "tsc -p tsconfig.test.json --noEmit",
|
|
27
|
-
"test": "npm run build && npm run test:package && npm run test:types",
|
|
28
|
+
"test": "npm run build && npm run check:wasm-size && npm run test:package && npm run test:types",
|
|
28
29
|
"prepack": "npm test"
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|