Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ function encodeName (name) {
function prebuildName (target, opts) {
var tags = [encodeName(opts.name || target.runtime)]

if (!opts.napi) {
if (opts.napi) {
tags.push('napi')
} else {
tags.push('abi' + abi.getAbi(target.target, target.runtime))
}

Expand Down
23 changes: 23 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ test('build with current node version', function (t) {
})
})

test('runtime napi flags', function (t) {
prebuildify({
cwd: path.join(__dirname, 'package'),
targets: [{ runtime: 'node', target: process.version }],
napi: true,
tagLibc: true // Should be glibc (unless you run these tests on Alpine)
}, function (err) {
t.ifError(err)
t.doesNotThrow(function () {
var folder = os.platform() + '-' + os.arch()
var name = [
'addon',
'napi',
'glibc',
'node'
].join('.')
var addon = require(path.join(__dirname, 'package', 'prebuilds', folder, name))
t.equal(addon.check(), 'prebuildify')
})
t.end()
})
})

test('uv, armv and libc tags', function (t) {
prebuildify({
cwd: path.join(__dirname, 'package'),
Expand Down