@hongdown/wasm 0.2.0-dev.0 → 0.2.0-dev.69
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 +64 -0
- package/dist/hongdown_bg.wasm +0 -0
- package/package.json +74 -74
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@hongdown/wasm
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
A WebAssembly-based Markdown formatter library that enforces
|
|
5
|
+
[Hong Minhee's Markdown style conventions].
|
|
6
|
+
|
|
7
|
+
This package provides the same formatting as the [Hongdown CLI], but as a
|
|
8
|
+
JavaScript/TypeScript library that works in Node.js, Bun, Deno, and web
|
|
9
|
+
browsers.
|
|
10
|
+
|
|
11
|
+
[Hong Minhee's Markdown style conventions]: https://github.com/dahlia/hongdown/blob/main/STYLE.md
|
|
12
|
+
[Hongdown CLI]: https://www.npmjs.com/package/hongdown
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
Installation
|
|
16
|
+
------------
|
|
17
|
+
|
|
18
|
+
~~~~ bash
|
|
19
|
+
npm install @hongdown/wasm
|
|
20
|
+
~~~~
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Usage
|
|
24
|
+
-----
|
|
25
|
+
|
|
26
|
+
~~~~ typescript
|
|
27
|
+
import { format, formatWithWarnings } from "@hongdown/wasm";
|
|
28
|
+
|
|
29
|
+
// Basic usage
|
|
30
|
+
const markdown = "# Hello\nWorld";
|
|
31
|
+
const formatted = await format(markdown);
|
|
32
|
+
|
|
33
|
+
// With options
|
|
34
|
+
const result = await format(markdown, {
|
|
35
|
+
lineWidth: 100,
|
|
36
|
+
setextH1: false,
|
|
37
|
+
fenceChar: "`",
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Get warnings along with formatted output
|
|
41
|
+
const { output, warnings } = await formatWithWarnings(markdown);
|
|
42
|
+
if (warnings.length > 0) {
|
|
43
|
+
for (const warning of warnings) {
|
|
44
|
+
console.warn(`Line ${warning.line}: ${warning.message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
~~~~
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Options
|
|
51
|
+
-------
|
|
52
|
+
|
|
53
|
+
All options are optional. See the [TypeScript type definitions] for the
|
|
54
|
+
complete list of available options.
|
|
55
|
+
|
|
56
|
+
[TypeScript type definitions]: https://github.com/dahlia/hongdown/blob/main/npm/wasm/src/types.ts
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
License
|
|
60
|
+
-------
|
|
61
|
+
|
|
62
|
+
Distributed under the [GPL-3.0-or-later].
|
|
63
|
+
|
|
64
|
+
[GPL-3.0-or-later]: https://www.gnu.org/licenses/gpl-3.0.html
|
package/dist/hongdown_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
"name": "@hongdown/wasm",
|
|
3
|
+
"version": "0.2.0-dev.69+25f3a0fa",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "WASM-based Markdown formatter library for Hong Minhee's style conventions",
|
|
6
|
+
"license": "GPL-3.0-or-later",
|
|
7
|
+
"author": "Hong Minhee \u003chong@minhee.org\u003e",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/dahlia/hongdown.git",
|
|
11
|
+
"directory": "npm/wasm"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/dahlia/hongdown",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"Markdown",
|
|
16
|
+
"formatter",
|
|
17
|
+
"WASM",
|
|
18
|
+
"WebAssembly"
|
|
19
|
+
],
|
|
20
|
+
"imports": {
|
|
21
|
+
"#wasm-loader": {
|
|
22
|
+
"node": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/loader-node.d.mts",
|
|
25
|
+
"default": "./dist/loader-node.mjs"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/loader-node.d.cts",
|
|
29
|
+
"default": "./dist/loader-node.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"default": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/loader-web.d.mts",
|
|
35
|
+
"default": "./dist/loader-web.mjs"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/loader-web.d.cts",
|
|
39
|
+
"default": "./dist/loader-web.cjs"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
30
42
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
},
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./dist/index.d.mts",
|
|
48
|
+
"default": "./dist/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./dist/index.d.cts",
|
|
52
|
+
"default": "./dist/index.cjs"
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
|
-
|
|
55
|
+
},
|
|
56
|
+
"main": "./dist/index.cjs",
|
|
57
|
+
"module": "./dist/index.mjs",
|
|
58
|
+
"types": "./dist/index.d.mts",
|
|
59
|
+
"files": [
|
|
60
|
+
"dist/",
|
|
61
|
+
"README.md"
|
|
62
|
+
],
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": "\u003e=18"
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "tsdown",
|
|
68
|
+
"test": "tsdown \u0026\u0026 node --experimental-transform-types --test test/*.test.ts \u0026\u0026 bun test test/ \u0026\u0026 deno test --allow-read test/",
|
|
69
|
+
"test:node": "tsdown \u0026\u0026 node --experimental-transform-types --test test/*.test.ts",
|
|
70
|
+
"test:bun": "tsdown \u0026\u0026 bun test test/",
|
|
71
|
+
"test:deno": "tsdown \u0026\u0026 deno test --allow-read test/",
|
|
72
|
+
"prepublishOnly": "npm run build"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/node": "^22.0.0",
|
|
76
|
+
"tsdown": "^0.20.0-beta.1",
|
|
77
|
+
"typescript": "^5.0.0"
|
|
42
78
|
}
|
|
43
|
-
},
|
|
44
|
-
"exports": {
|
|
45
|
-
".": {
|
|
46
|
-
"import": {
|
|
47
|
-
"types": "./dist/index.d.mts",
|
|
48
|
-
"default": "./dist/index.mjs"
|
|
49
|
-
},
|
|
50
|
-
"require": {
|
|
51
|
-
"types": "./dist/index.d.cts",
|
|
52
|
-
"default": "./dist/index.cjs"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"main": "./dist/index.cjs",
|
|
57
|
-
"module": "./dist/index.mjs",
|
|
58
|
-
"types": "./dist/index.d.mts",
|
|
59
|
-
"files": [
|
|
60
|
-
"dist/",
|
|
61
|
-
"README.md"
|
|
62
|
-
],
|
|
63
|
-
"engines": {
|
|
64
|
-
"node": ">=18"
|
|
65
|
-
},
|
|
66
|
-
"scripts": {
|
|
67
|
-
"build": "tsdown",
|
|
68
|
-
"test": "tsdown && node --experimental-transform-types --test test/*.test.ts && bun test test/ && deno test --allow-read test/",
|
|
69
|
-
"test:node": "tsdown && node --experimental-transform-types --test test/*.test.ts",
|
|
70
|
-
"test:bun": "tsdown && bun test test/",
|
|
71
|
-
"test:deno": "tsdown && deno test --allow-read test/",
|
|
72
|
-
"prepublishOnly": "npm run build"
|
|
73
|
-
},
|
|
74
|
-
"devDependencies": {
|
|
75
|
-
"@types/node": "^22.0.0",
|
|
76
|
-
"tsdown": "^0.20.0-beta.1",
|
|
77
|
-
"typescript": "^5.0.0"
|
|
78
|
-
}
|
|
79
79
|
}
|