mdream 1.7.1 → 1.7.2

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,4 @@
1
- interface CleanOptions {
1
+ export interface CleanOptions {
2
2
  /** Strip tracking query parameters (utm_*, fbclid, gclid, etc.) from URLs */
3
3
  urls?: boolean;
4
4
  /** Strip fragment-only links that don't match any heading in the output */
@@ -16,19 +16,19 @@ interface CleanOptions {
16
16
  /** Drop links that produce no visible text: [](url) → nothing */
17
17
  emptyLinkText?: boolean;
18
18
  }
19
- interface ExtractedElement {
19
+ export interface ExtractedElement {
20
20
  selector: string;
21
21
  tagName: string;
22
22
  textContent: string;
23
23
  attributes: Record<string, string>;
24
24
  }
25
- interface FrontmatterConfig {
25
+ export interface FrontmatterConfig {
26
26
  additionalFields?: Record<string, string>;
27
27
  metaFields?: string[];
28
28
  /** Callback to receive structured frontmatter data after conversion */
29
29
  onExtract?: (frontmatter: Record<string, string>) => void;
30
30
  }
31
- interface TagOverride {
31
+ export interface TagOverride {
32
32
  enter?: string;
33
33
  exit?: string;
34
34
  spacing?: number[];
@@ -37,7 +37,7 @@ interface TagOverride {
37
37
  collapsesInnerWhiteSpace?: boolean;
38
38
  alias?: string;
39
39
  }
40
- interface MdreamOptions {
40
+ export interface MdreamOptions {
41
41
  /** Origin URL for resolving relative image paths and internal links. */
42
42
  origin?: string;
43
43
  /**
@@ -81,6 +81,5 @@ interface MdreamOptions {
81
81
  */
82
82
  format?: 'markdown' | 'text' | 'html';
83
83
  }
84
- declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>): string;
85
- declare function streamHtmlToMarkdown(htmlStream: ReadableStream<Uint8Array | string> | null, options?: Partial<MdreamOptions>): AsyncIterable<string>;
86
- export { CleanOptions, ExtractedElement, FrontmatterConfig, MdreamOptions, TagOverride, htmlToMarkdown, streamHtmlToMarkdown };
84
+ export declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>): string;
85
+ export declare function streamHtmlToMarkdown(htmlStream: ReadableStream<Uint8Array | string> | null, options?: Partial<MdreamOptions>): AsyncIterable<string>;
package/dist/worker.d.mts CHANGED
@@ -85,14 +85,13 @@ interface MdreamOptions {
85
85
  * Initialize the mdream web worker. Must be called before htmlToMarkdown.
86
86
  * @param wasmUrl - URL to the mdream_edge_bg.wasm file
87
87
  */
88
- declare function initWorker(wasmUrl: string): Promise<void>;
88
+ export declare function initWorker(wasmUrl: string): Promise<void>;
89
89
  /**
90
90
  * Convert HTML to markdown using the web worker.
91
91
  * Call initWorker() first.
92
92
  */
93
- declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>): Promise<string>;
93
+ export declare function htmlToMarkdown(html: string, options?: Partial<MdreamOptions>): Promise<string>;
94
94
  /**
95
95
  * Terminate the web worker and free resources.
96
96
  */
97
- declare function terminateWorker(): void;
98
- export { htmlToMarkdown, initWorker, terminateWorker };
97
+ export declare function terminateWorker(): void;
package/napi/index.mjs CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { createRequire } from 'module'
7
7
  const require = createRequire(import.meta.url)
8
- const __dirname = new URL('.', import.meta.url).pathname
9
8
 
10
9
  const { readFileSync } = require('fs')
11
10
  let nativeBinding = null
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mdream",
3
3
  "type": "module",
4
- "version": "1.7.1",
4
+ "version": "1.7.2",
5
5
  "description": "Ultra-performant HTML to Markdown Convertor Optimized for LLMs and llm.txt artifacts.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -57,22 +57,23 @@
57
57
  "browser": "./dist/browser.mjs",
58
58
  "dependencies": {},
59
59
  "optionalDependencies": {
60
- "@mdream/rust-android-arm-eabi": "1.7.1",
61
- "@mdream/rust-android-arm64": "1.7.1",
62
- "@mdream/rust-darwin-x64": "1.7.1",
63
- "@mdream/rust-freebsd-x64": "1.7.1",
64
- "@mdream/rust-linux-arm-gnueabihf": "1.7.1",
65
- "@mdream/rust-linux-arm64-gnu": "1.7.1",
66
- "@mdream/rust-darwin-arm64": "1.7.1",
67
- "@mdream/rust-linux-arm64-musl": "1.7.1",
68
- "@mdream/rust-linux-x64-musl": "1.7.1",
69
- "@mdream/rust-linux-x64-gnu": "1.7.1",
70
- "@mdream/rust-wasm32-wasi": "1.7.1",
71
- "@mdream/rust-win32-arm64-msvc": "1.7.1",
72
- "@mdream/rust-win32-x64-msvc": "1.7.1"
60
+ "@mdream/rust-android-arm-eabi": "1.7.2",
61
+ "@mdream/rust-android-arm64": "1.7.2",
62
+ "@mdream/rust-darwin-arm64": "1.7.2",
63
+ "@mdream/rust-darwin-x64": "1.7.2",
64
+ "@mdream/rust-freebsd-x64": "1.7.2",
65
+ "@mdream/rust-linux-arm-gnueabihf": "1.7.2",
66
+ "@mdream/rust-linux-arm64-gnu": "1.7.2",
67
+ "@mdream/rust-linux-arm64-musl": "1.7.2",
68
+ "@mdream/rust-linux-x64-gnu": "1.7.2",
69
+ "@mdream/rust-linux-x64-musl": "1.7.2",
70
+ "@mdream/rust-wasm32-wasi": "1.7.2",
71
+ "@mdream/rust-win32-arm64-msvc": "1.7.2",
72
+ "@mdream/rust-win32-x64-msvc": "1.7.2"
73
73
  },
74
74
  "devDependencies": {
75
- "@mdream/js": "1.7.1"
75
+ "@mdream/js": "1.7.2",
76
+ "@mdream/rust-build": "0.17.0"
76
77
  },
77
78
  "scripts": {
78
79
  "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.7.1",
5
+ "version": "1.7.2",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "mdream_edge_bg.wasm",
Binary file
@@ -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.7.1",
5
+ "version": "1.7.2",
6
6
  "license": "MIT",
7
7
  "files": [
8
8
  "mdream_edge_bg.wasm",