mdream 1.0.2 → 1.0.4

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/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/index.d.ts
2
1
  interface CleanOptions {
3
2
  /** Strip tracking query parameters (utm_*, fbclid, gclid, etc.) from URLs */
4
3
  urls?: boolean;
@@ -73,5 +72,4 @@ interface MdreamOptions {
73
72
  }
74
73
  declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>): string;
75
74
  declare function streamHtmlToMarkdown(htmlStream: ReadableStream<Uint8Array | string> | null, options?: Partial<MdreamOptions>): AsyncIterable<string>;
76
- //#endregion
77
75
  export { CleanOptions, ExtractedElement, FrontmatterConfig, MdreamOptions, TagOverride, htmlToMarkdown, streamHtmlToMarkdown };
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { MarkdownStream, htmlToMarkdown as htmlToMarkdown$1 } from "../napi/index.mjs";
2
- //#region src/index.ts
3
2
  const MINIMAL_FILTER_DEFAULT = { exclude: [
4
3
  "form",
5
4
  "fieldset",
@@ -110,5 +109,4 @@ async function* streamHtmlToMarkdown(htmlStream, options = {}) {
110
109
  reader.releaseLock();
111
110
  }
112
111
  }
113
- //#endregion
114
112
  export { htmlToMarkdown, streamHtmlToMarkdown };
package/dist/worker.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/index.d.ts
2
1
  interface CleanOptions {
3
2
  /** Strip tracking query parameters (utm_*, fbclid, gclid, etc.) from URLs */
4
3
  urls?: boolean;
@@ -71,8 +70,6 @@ interface MdreamOptions {
71
70
  /** Tag overrides. String values act as aliases */
72
71
  tagOverrides?: Record<string, TagOverride | string>;
73
72
  }
74
- //#endregion
75
- //#region src/worker.d.ts
76
73
  /**
77
74
  * Initialize the mdream web worker. Must be called before htmlToMarkdown.
78
75
  * @param wasmUrl - URL to the mdream_edge_bg.wasm file
@@ -87,5 +84,4 @@ declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>):
87
84
  * Terminate the web worker and free resources.
88
85
  */
89
86
  declare function terminateWorker(): void;
90
- //#endregion
91
87
  export { htmlToMarkdown, initWorker, terminateWorker };
package/dist/worker.mjs CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/worker.ts
2
1
  let _worker = null;
3
2
  let _ready = null;
4
3
  let _idCounter = 0;
@@ -48,10 +47,6 @@ function onMessage(e) {
48
47
  else pending.reject(new Error(msg.message));
49
48
  }
50
49
  }
51
- /**
52
- * Initialize the mdream web worker. Must be called before htmlToMarkdown.
53
- * @param wasmUrl - URL to the mdream_edge_bg.wasm file
54
- */
55
50
  function initWorker(wasmUrl) {
56
51
  if (_ready) return _ready;
57
52
  _ready = new Promise((resolve, reject) => {
@@ -71,10 +66,6 @@ function initWorker(wasmUrl) {
71
66
  });
72
67
  return _ready;
73
68
  }
74
- /**
75
- * Convert HTML to markdown using the web worker.
76
- * Call initWorker() first.
77
- */
78
69
  function htmlToMarkdown(html, options) {
79
70
  if (!_worker || !_ready) return Promise.reject(/* @__PURE__ */ new Error("Call initWorker() before htmlToMarkdown()"));
80
71
  return _ready.then(() => {
@@ -93,9 +84,6 @@ function htmlToMarkdown(html, options) {
93
84
  });
94
85
  });
95
86
  }
96
- /**
97
- * Terminate the web worker and free resources.
98
- */
99
87
  function terminateWorker() {
100
88
  if (_worker) {
101
89
  _worker.terminate();
@@ -105,5 +93,4 @@ function terminateWorker() {
105
93
  for (const [, pending] of _pending) pending.reject(/* @__PURE__ */ new Error("Worker terminated"));
106
94
  _pending.clear();
107
95
  }
108
- //#endregion
109
96
  export { htmlToMarkdown, initWorker, terminateWorker };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mdream",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "description": "Ultra-performant HTML to Markdown Convertor Optimized for LLMs and llm.txt artifacts.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -51,22 +51,22 @@
51
51
  "browser": "./dist/browser.mjs",
52
52
  "dependencies": {},
53
53
  "optionalDependencies": {
54
- "@mdream/rust-android-arm-eabi": "1.0.2",
55
- "@mdream/rust-android-arm64": "1.0.2",
56
- "@mdream/rust-darwin-arm64": "1.0.2",
57
- "@mdream/rust-darwin-x64": "1.0.2",
58
- "@mdream/rust-freebsd-x64": "1.0.2",
59
- "@mdream/rust-linux-arm64-gnu": "1.0.2",
60
- "@mdream/rust-linux-arm64-musl": "1.0.2",
61
- "@mdream/rust-linux-arm-gnueabihf": "1.0.2",
62
- "@mdream/rust-linux-x64-gnu": "1.0.2",
63
- "@mdream/rust-linux-x64-musl": "1.0.2",
64
- "@mdream/rust-wasm32-wasi": "1.0.2",
65
- "@mdream/rust-win32-x64-msvc": "1.0.2",
66
- "@mdream/rust-win32-arm64-msvc": "1.0.2"
54
+ "@mdream/rust-android-arm64": "1.0.4",
55
+ "@mdream/rust-darwin-arm64": "1.0.4",
56
+ "@mdream/rust-darwin-x64": "1.0.4",
57
+ "@mdream/rust-freebsd-x64": "1.0.4",
58
+ "@mdream/rust-android-arm-eabi": "1.0.4",
59
+ "@mdream/rust-linux-arm-gnueabihf": "1.0.4",
60
+ "@mdream/rust-linux-arm64-gnu": "1.0.4",
61
+ "@mdream/rust-linux-arm64-musl": "1.0.4",
62
+ "@mdream/rust-linux-x64-musl": "1.0.4",
63
+ "@mdream/rust-linux-x64-gnu": "1.0.4",
64
+ "@mdream/rust-wasm32-wasi": "1.0.4",
65
+ "@mdream/rust-win32-arm64-msvc": "1.0.4",
66
+ "@mdream/rust-win32-x64-msvc": "1.0.4"
67
67
  },
68
68
  "devDependencies": {
69
- "@mdream/js": "1.0.2"
69
+ "@mdream/js": "1.0.4"
70
70
  },
71
71
  "scripts": {
72
72
  "flame": "pnpm build && unbuild bench/bundle && clinic flame -- node bench/bundle/dist/string.mjs 10",
Binary file
package/wasm/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mdream-edge",
3
3
  "type": "module",
4
4
  "description": "WebAssembly edge runtime bindings for mdream HTML-to-Markdown converter",
5
- "version": "1.0.2",
5
+ "version": "1.0.4",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "mdream_edge_bg.wasm",