-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale
Description
Is your feature request related to a problem? Please describe.
I need to dectect the libc
version and type on Linux systems to determined which native addon I need to load.
The most common ways in Node.js to do such things is using the detect-libc
package, which is actully invoke shell scripts and try to read messages in the stdout, not elegant at all.
The other way is using try ... catch
on Linux:
try {
return require('my-native-addon.x64-linux-gnu.node')
} catch {
return require('my-native-addon.x64-linux-musl.node')
}
not elegant either and more complicated.
Describe the solution you'd like
I want get libc
information on process.versions
directly, like:
console.log(process.versions.libc)
{
family: 'glibc',
version: '2.24'
}
For the other systems don't need to consider about libc problem, just leave the fields as null.
yisibl, leeight, styfle and Beraliv
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.stale