Rough idea: prebuildify would write a JSON file containing build metadata (platform, arch, abi, etc). A secondary tool (serving a similar role as prebuildify-ci) would collect those files and generate a binding.js to be included in your npm package. E.g.:
if (platform === 'linux' && arch === 'x64') {
module.exports = require('./prebuilds/linux-x64/example.node')
} else {
throw new Error('No native build was found for ...')
}
Removing the need to discover files at runtime.
Rough idea:
prebuildifywould write a JSON file containing build metadata (platform, arch, abi, etc). A secondary tool (serving a similar role asprebuildify-ci) would collect those files and generate abinding.jsto be included in your npm package. E.g.:Removing the need to discover files at runtime.