Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

napi-maybe-compressed-blob

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

napi-maybe-compressed-blob - npm Package Compare versions

Comparing version 0.0.2 to 0.0.7

6

index.d.ts

@@ -6,9 +6,3 @@ /* tslint:disable */

export class ExternalObject<T> {
readonly '': {
readonly '': unique symbol
[K: symbol]: T
}
}
export function compress(buf: Buffer): Buffer
export function decompress(buf: Buffer): Buffer

61

index.js

@@ -8,20 +8,49 @@ const { existsSync, readFileSync } = require('fs')

let localFileExisted = false
let isMusl = false
let loadError = null
function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
const lddPath = require('child_process').execSync('which ldd').toString().trim();
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header
return !glibcVersionRuntime
}
}
switch (platform) {
case 'android':
if (arch !== 'arm64') {
throw new Error(`Unsupported architecture on Android ${arch}`)
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'napi-maybe-compressed-blob.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./napi-maybe-compressed-blob.android-arm64.node')
} else {
nativeBinding = require('napi-maybe-compressed-blob-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'napi-maybe-compressed-blob.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./napi-maybe-compressed-blob.android-arm-eabi.node')
} else {
nativeBinding = require('napi-maybe-compressed-blob-android-arm-eabi')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'napi-maybe-compressed-blob.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./napi-maybe-compressed-blob.android-arm64.node')
} else {
nativeBinding = require('napi-maybe-compressed-blob-android-arm64')
}
} catch (e) {
loadError = e
}
break

@@ -126,4 +155,3 @@ case 'win32':

case 'x64':
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
if (isMusl) {
if (isMusl()) {
localFileExisted = existsSync(

@@ -157,4 +185,3 @@ join(__dirname, 'napi-maybe-compressed-blob.linux-x64-musl.node')

case 'arm64':
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
if (isMusl) {
if (isMusl()) {
localFileExisted = existsSync(

@@ -161,0 +188,0 @@ join(__dirname, 'napi-maybe-compressed-blob.linux-arm64-musl.node')

{
"name": "napi-maybe-compressed-blob",
"version": "0.0.2",
"version": "0.0.7",
"main": "index.js",

@@ -10,3 +10,6 @@ "types": "index.d.ts",

"additional": [
"aarch64-apple-darwin"
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu"
]

@@ -17,3 +20,3 @@ }

"devDependencies": {
"@napi-rs/cli": "^2.2.0",
"@napi-rs/cli": "^2.11.4",
"mocha": "9.1.3"

@@ -33,7 +36,8 @@ },

"optionalDependencies": {
"napi-maybe-compressed-blob-win32-x64-msvc": "0.0.2",
"napi-maybe-compressed-blob-darwin-x64": "0.0.2",
"napi-maybe-compressed-blob-linux-x64-gnu": "0.0.2",
"napi-maybe-compressed-blob-darwin-arm64": "0.0.2"
"napi-maybe-compressed-blob-win32-x64-msvc": "0.0.7",
"napi-maybe-compressed-blob-darwin-x64": "0.0.7",
"napi-maybe-compressed-blob-linux-x64-gnu": "0.0.7",
"napi-maybe-compressed-blob-darwin-arm64": "0.0.7",
"napi-maybe-compressed-blob-linux-arm64-gnu": "0.0.7"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc