detect-libc
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -8,7 +8,12 @@ #!/usr/bin/env node | ||
const spawnOptions = { stdio: 'inherit', env: process.env }; | ||
const spawnOptions = { | ||
env: process.env, | ||
shell: true, | ||
stdio: 'inherit' | ||
}; | ||
if (family) { | ||
spawnOptions.env.LIBC = family; | ||
spawnOptions.env.LIBC = process.env.LIBC || family; | ||
} | ||
process.exit(spawnSync(process.argv[2], process.argv.slice(3), spawnOptions).status); |
@@ -6,3 +6,6 @@ 'use strict'; | ||
const spawnOptions = { encoding: 'utf8' }; | ||
const spawnOptions = { | ||
encoding: 'utf8', | ||
env: process.env | ||
}; | ||
@@ -28,9 +31,2 @@ let family = ''; | ||
} | ||
} else if (platform === 'darwin') { | ||
// Try otool | ||
const otool = spawnSync('otool', ['-L', '/usr/lib/libc.dylib'], spawnOptions); | ||
if (otool.status === 0) { | ||
family = 'bsd'; | ||
version = otool.stdout.split(/[\r\n]+/)[1].trim().split(/\s/)[6].replace(')', ''); | ||
} | ||
} | ||
@@ -37,0 +33,0 @@ |
{ | ||
"name": "detect-libc", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Node.js module to detect the C standard library (libc) implementation family and version", | ||
@@ -5,0 +5,0 @@ "main": "lib/detect-libc.js", |
# detect-libc | ||
Node.js module to detect the C standard library (libc) implementation | ||
family and version in use on a given system. | ||
family and version in use on a given Linux system. | ||
Provides a value suitable for use with the `libc` option of | ||
Provides a value suitable for use with the `LIBC` option of | ||
[prebuild](https://www.npmjs.com/package/prebuild), | ||
@@ -13,3 +13,3 @@ [prebuild-ci](https://www.npmjs.com/package/prebuild-ci) and | ||
Currently supports libc detection on Linux (glibc, musl) and OS X (bsd). | ||
Currently supports libc detection of `glibc` and `musl`. | ||
@@ -26,4 +26,5 @@ ## Install | ||
Command line tool that spawns the child `command` with the `LIBC` | ||
environment variable set to the value of the system libc family. | ||
Command line tool that spawns the child `command`. | ||
When run on a Linux platform the `LIBC` environment variable | ||
will be set to the value of the system libc family. | ||
@@ -47,3 +48,3 @@ ### API | ||
"dependencies": { | ||
"detect-libc": "^0.0.5", | ||
"detect-libc": "^0.0.6", | ||
"prebuild-install": "^2.1.2" | ||
@@ -50,0 +51,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68
15163
3