@datadog/libdatadog
Advanced tools
Comparing version
17
load.js
@@ -27,8 +27,19 @@ 'use strict' | ||
const filename = find(name) | ||
const filenameWASM = findWASM(name) | ||
if (!filename) { | ||
throw new Error(`Could not find a ${name} binary for ${PLATFORM}${LIBC}-${ARCH}.`) | ||
if (filename) { | ||
return runtimeRequire(filename) | ||
} else if (filenameWASM) { | ||
return runtimeRequire(filenameWASM) | ||
} | ||
throw new Error(`Could not find a ${name} binary for ${PLATFORM}${LIBC}-${ARCH} nor a ${name} WASM module.`) | ||
} | ||
return runtimeRequire(filename) | ||
function findWASM (name) { | ||
const root = __dirname | ||
const prebuilds = path.join(root, 'prebuilds') | ||
const folders = readdirSync(prebuilds) | ||
if (folders.find(f => f === name)) { | ||
return path.join(prebuilds, name, `${name}.js`) | ||
} | ||
} | ||
@@ -35,0 +46,0 @@ |
{ | ||
"name": "@datadog/libdatadog", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Node.js binding for libdatadog", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "yarn -s build-debug", | ||
"install-wasm-pack": "curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh", | ||
"build": "yarn -s build-debug && yarn -s build-wasm", | ||
"build-debug": "mkdir -p target && yarn -s cargo-build > ./target/out.ndjson && yarn -s copy-artifacts", | ||
"build-release": "mkdir -p target && yarn -s cargo-build-release > ./target/out.ndjson && yarn -s copy-artifacts", | ||
"build-all": "mkdir -p target && yarn -s cargo-build -- --workspace > ./target/out.ndjson && yarn -s copy-artifacts", | ||
"build-all": "mkdir -p target && yarn -s cargo-build -- --workspace > ./target/out.ndjson && yarn -s copy-artifacts && yarn -s build-wasm", | ||
"build-wasm": "yarn -s install-wasm-pack && wasm-pack build --target nodejs ./crates/library_config --out-dir ../../prebuilds/library_config", | ||
"cargo-build-release": "yarn -s cargo-build -- --release", | ||
@@ -12,0 +14,0 @@ "cargo-build": "cargo build --message-format=json-render-diagnostics", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
29831063
1.34%22
29.41%534
836.84%5
150%13
8.33%