Socket
Socket
Sign inDemoInstall

detect-libc

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-libc - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

6

bin/detect-libc.js

@@ -5,6 +5,6 @@ #!/usr/bin/env node

const spawnSync = require('child_process').spawnSync;
const libc = require('../');
var spawnSync = require('child_process').spawnSync;
var libc = require('../');
const spawnOptions = {
var spawnOptions = {
env: process.env,

@@ -11,0 +11,0 @@ shell: true,

'use strict';
const platform = require('os').platform();
const spawnSync = require('child_process').spawnSync;
const readdirSync = require('fs').readdirSync;
var platform = require('os').platform();
var spawnSync = require('child_process').spawnSync;
var readdirSync = require('fs').readdirSync;
const GLIBC = 'glibc';
const MUSL = 'musl';
var GLIBC = 'glibc';
var MUSL = 'musl';
const spawnOptions = {
var spawnOptions = {
encoding: 'utf8',

@@ -21,8 +21,8 @@ env: process.env

let family = '';
let version = '';
var family = '';
var version = '';
if (platform === 'linux') {
if (spawnSync && platform === 'linux') {
// Try getconf
const glibc = spawnSync('getconf', ['GNU_LIBC_VERSION'], spawnOptions);
var glibc = spawnSync('getconf', ['GNU_LIBC_VERSION'], spawnOptions);
if (glibc.status === 0) {

@@ -33,3 +33,3 @@ family = GLIBC;

// Try ldd
const ldd = spawnSync('ldd', ['--version'], spawnOptions);
var ldd = spawnSync('ldd', ['--version'], spawnOptions);
if (ldd.status === 0 && ldd.stdout.indexOf('musl') !== -1) {

@@ -41,3 +41,3 @@ family = MUSL;

try {
const lib = readdirSync('/lib');
var lib = readdirSync('/lib');
if (lib.some(contains('-linux-gnu'))) {

@@ -55,3 +55,3 @@ family = GLIBC;

const isNonGlibcLinux = (family !== '' && family !== GLIBC);
var isNonGlibcLinux = (family !== '' && family !== GLIBC);

@@ -58,0 +58,0 @@ module.exports = {

{
"name": "detect-libc",
"version": "0.2.0",
"version": "1.0.0",
"description": "Node.js module to detect the C standard library (libc) implementation family and version",

@@ -24,4 +24,4 @@ "main": "lib/detect-libc.js",

"devDependencies": {
"ava": "^0.20.0",
"nyc": "^11.0.3",
"ava": "^0.23.0",
"nyc": "^11.2.1",
"proxyquire": "^1.8.0",

@@ -31,4 +31,4 @@ "semistandard": "^11.0.0"

"engines": {
"node": ">=4"
"node": ">=0.10"
}
}

@@ -35,2 +35,5 @@ # detect-libc

This feature will always return `false` for `isNonGlibcLinux`
on versions of Node prior to v0.12 as `spawnSync` is unavailable.
### detect-libc command line tool

@@ -44,2 +47,4 @@

This feature requires `spawnSync` provided by Node v0.12+.
```sh

@@ -46,0 +51,0 @@ detect-libc child-command

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc