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.
Is your feature request related to a problem? Please describe.
I need to dectect the
libcversion 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-libcpackage, which is actully invoke shell scripts and try to read messages in the stdout, not elegant at all.The other way is using
try ... catchon Linux:not elegant either and more complicated.
Describe the solution you'd like
I want get
libcinformation onprocess.versionsdirectly, like:For the other systems don't need to consider about libc problem, just leave the fields as null.