writr 5.0.2 → 5.0.3
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 +18 -5
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -730,14 +730,27 @@ For more information about event handling capabilities, see the [Hookified docum
|
|
|
730
730
|
|
|
731
731
|
# Benchmarks
|
|
732
732
|
|
|
733
|
-
|
|
733
|
+
This is a comparison with minimal configuration where we have disabled all rendering pipeline and just did straight caching + rendering to compare it against the fastest:
|
|
734
734
|
|
|
735
735
|
| name | summary | ops/sec | time/op | margin | samples |
|
|
736
736
|
|---------------------------|:---------:|----------:|----------:|:--------:|----------:|
|
|
737
|
-
|
|
|
738
|
-
|
|
|
739
|
-
|
|
|
740
|
-
|
|
|
737
|
+
| Writr (Sync) (Caching) | 🥇 | 83K | 14µs | ±0.27% | 74K |
|
|
738
|
+
| Writr (Async) (Caching) | -3% | 80K | 14µs | ±0.27% | 71K |
|
|
739
|
+
| markdown-it | -30% | 58K | 20µs | ±0.37% | 50K |
|
|
740
|
+
| marked | -33% | 56K | 25µs | ±0.50% | 40K |
|
|
741
|
+
| Writr (Sync) | -94% | 5K | 225µs | ±0.88% | 10K |
|
|
742
|
+
| Writr (Async) | -94% | 5K | 229µs | ±0.89% | 10K |
|
|
743
|
+
|
|
744
|
+
As you can see this module is performant with `caching` enabled but was built to be performant enough but with all the features added in. If you are just wanting performance and not features then `markdown-it` or `marked` is the solution unless you use `Writr` with caching.
|
|
745
|
+
|
|
746
|
+
| name | summary | ops/sec | time/op | margin | samples |
|
|
747
|
+
|---------------------------|:---------:|----------:|----------:|:--------:|----------:|
|
|
748
|
+
| Writr (Async) (Caching) | 🥇 | 26K | 39µs | ±0.12% | 25K |
|
|
749
|
+
| Writr (Sync) (Caching) | -0.92% | 26K | 40µs | ±0.15% | 25K |
|
|
750
|
+
| Writr (Sync) | -93% | 2K | 630µs | ±0.97% | 10K |
|
|
751
|
+
| Writr (Async) | -93% | 2K | 649µs | ±0.96% | 10K |
|
|
752
|
+
|
|
753
|
+
The benchmark shows rendering performance via Sync and Async methods with caching enabled and disabled and all features.
|
|
741
754
|
|
|
742
755
|
# ESM and Node Version Support
|
|
743
756
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "writr",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Markdown Rendering Simplified",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/writr.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"cacheable": "^2.3.1",
|
|
53
53
|
"hashery": "^1.3.0",
|
|
54
54
|
"hookified": "^1.14.0",
|
|
55
|
-
"html-react-parser": "^5.2.
|
|
55
|
+
"html-react-parser": "^5.2.12",
|
|
56
56
|
"js-yaml": "^4.1.1",
|
|
57
57
|
"react": "^19.2.3",
|
|
58
58
|
"rehype-highlight": "^7.0.2",
|
|
@@ -70,19 +70,22 @@
|
|
|
70
70
|
"unified": "^11.0.5"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@biomejs/biome": "^2.3.
|
|
73
|
+
"@biomejs/biome": "^2.3.12",
|
|
74
74
|
"@monstermann/tinybench-pretty-printer": "^0.3.0",
|
|
75
75
|
"@types/js-yaml": "^4.0.9",
|
|
76
|
-
"@types/
|
|
77
|
-
"@types/
|
|
78
|
-
"@
|
|
79
|
-
"
|
|
76
|
+
"@types/markdown-it": "^14.1.2",
|
|
77
|
+
"@types/node": "^25.0.10",
|
|
78
|
+
"@types/react": "^19.2.9",
|
|
79
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
80
|
+
"docula": "^0.40.0",
|
|
81
|
+
"markdown-it": "^14.1.0",
|
|
82
|
+
"marked": "^17.0.1",
|
|
80
83
|
"rimraf": "^6.1.2",
|
|
81
84
|
"tinybench": "^6.0.0",
|
|
82
85
|
"tsup": "^8.5.1",
|
|
83
86
|
"tsx": "^4.21.0",
|
|
84
87
|
"typescript": "^5.9.3",
|
|
85
|
-
"vitest": "^4.0.
|
|
88
|
+
"vitest": "^4.0.18"
|
|
86
89
|
},
|
|
87
90
|
"files": [
|
|
88
91
|
"dist",
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
"clean": "rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist",
|
|
94
97
|
"build": "rimraf ./dist && tsup src/writr.ts --format esm --dts --clean",
|
|
95
98
|
"lint": "biome check --write --error-on-warnings",
|
|
96
|
-
"benchmark": "tsx benchmark/benchmark.ts",
|
|
99
|
+
"benchmark": "tsx benchmark/benchmark-minimal.ts && tsx benchmark/benchmark-standard.ts",
|
|
97
100
|
"test": "pnpm lint && vitest run --coverage",
|
|
98
101
|
"test:ci": "biome check --error-on-warnings && vitest run --coverage",
|
|
99
102
|
"website:build": "rimraf ./site/README.md ./site/dist && npx docula build -s ./site -o ./site/dist",
|