+12
-11
@@ -6,7 +6,7 @@ // prettier-ignore | ||
| import { createRequire } from 'node:module' | ||
| import { createRequire } from 'module' | ||
| const require = createRequire(import.meta.url) | ||
| const __dirname = new URL('.', import.meta.url).pathname | ||
| const { readFileSync } = require('node:fs') | ||
| const { readFileSync } = require('fs') | ||
| let nativeBinding = null | ||
@@ -41,3 +41,3 @@ const loadErrors = [] | ||
| let report = null | ||
| if (typeof process.report?.getReport === 'function') { | ||
| if (process.report && typeof process.report.getReport === 'function') { | ||
| process.report.excludeNetwork = true | ||
@@ -114,3 +114,3 @@ report = process.report.getReport() | ||
| if (process.arch === 'x64') { | ||
| if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { | ||
| if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) { | ||
| try { | ||
@@ -580,13 +580,14 @@ return require('./rust.win32-x64-gnu.node') | ||
| if (loadErrors.length > 0) { | ||
| throw new Error( | ||
| const error = new Error( | ||
| `Cannot find native binding. ` + | ||
| `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + | ||
| 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', | ||
| { | ||
| cause: loadErrors.reduce((err, cur) => { | ||
| cur.cause = err | ||
| return cur | ||
| }), | ||
| }, | ||
| ) | ||
| // assign instead of the `new Error(message, { cause })` options form, | ||
| // which Node < 16.9 silently ignores | ||
| error.cause = loadErrors.reduce((err, cur) => { | ||
| cur.cause = err | ||
| return cur | ||
| }) | ||
| throw error | ||
| } | ||
@@ -593,0 +594,0 @@ throw new Error(`Failed to load native binding`) |
+15
-15
| { | ||
| "name": "mdream", | ||
| "type": "module", | ||
| "version": "1.4.0", | ||
| "version": "1.4.1", | ||
| "description": "Ultra-performant HTML to Markdown Convertor Optimized for LLMs and llm.txt artifacts.", | ||
@@ -55,18 +55,18 @@ "author": { | ||
| "optionalDependencies": { | ||
| "@mdream/rust-android-arm-eabi": "1.4.0", | ||
| "@mdream/rust-android-arm64": "1.4.0", | ||
| "@mdream/rust-darwin-arm64": "1.4.0", | ||
| "@mdream/rust-darwin-x64": "1.4.0", | ||
| "@mdream/rust-freebsd-x64": "1.4.0", | ||
| "@mdream/rust-linux-arm-gnueabihf": "1.4.0", | ||
| "@mdream/rust-linux-arm64-gnu": "1.4.0", | ||
| "@mdream/rust-linux-arm64-musl": "1.4.0", | ||
| "@mdream/rust-linux-x64-musl": "1.4.0", | ||
| "@mdream/rust-wasm32-wasi": "1.4.0", | ||
| "@mdream/rust-win32-arm64-msvc": "1.4.0", | ||
| "@mdream/rust-win32-x64-msvc": "1.4.0", | ||
| "@mdream/rust-linux-x64-gnu": "1.4.0" | ||
| "@mdream/rust-android-arm64": "1.4.1", | ||
| "@mdream/rust-darwin-arm64": "1.4.1", | ||
| "@mdream/rust-darwin-x64": "1.4.1", | ||
| "@mdream/rust-android-arm-eabi": "1.4.1", | ||
| "@mdream/rust-linux-arm-gnueabihf": "1.4.1", | ||
| "@mdream/rust-linux-arm64-gnu": "1.4.1", | ||
| "@mdream/rust-freebsd-x64": "1.4.1", | ||
| "@mdream/rust-linux-arm64-musl": "1.4.1", | ||
| "@mdream/rust-linux-x64-gnu": "1.4.1", | ||
| "@mdream/rust-wasm32-wasi": "1.4.1", | ||
| "@mdream/rust-linux-x64-musl": "1.4.1", | ||
| "@mdream/rust-win32-arm64-msvc": "1.4.1", | ||
| "@mdream/rust-win32-x64-msvc": "1.4.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@mdream/js": "1.4.0" | ||
| "@mdream/js": "1.4.1" | ||
| }, | ||
@@ -73,0 +73,0 @@ "scripts": { |
@@ -5,3 +5,3 @@ { | ||
| "description": "WebAssembly edge runtime bindings for mdream HTML-to-Markdown converter", | ||
| "version": "1.4.0", | ||
| "version": "1.4.1", | ||
| "license": "MIT", | ||
@@ -8,0 +8,0 @@ "files": [ |
@@ -5,3 +5,3 @@ { | ||
| "description": "WebAssembly edge runtime bindings for mdream HTML-to-Markdown converter", | ||
| "version": "1.4.0", | ||
| "version": "1.4.1", | ||
| "license": "MIT", | ||
@@ -8,0 +8,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
819672
1.29%3156
0.54%63
3.28%