Skip to content

How to use multiple .node files? #57

@todbot

Description

@todbot

Hi, I'm the current maintainer of node-hid. It supports two different back-end native libraries on Linux: libusb or hidraw. The bindings loading currently looks like:

            if( !driverType || driverType === 'hidraw' ) {
                binding = require('bindings')('HID_hidraw.node');
            } else {
                binding = require('bindings')('HID.node');
            }
        }

How do I accomplish something similar using prebuildify and node-gyp-build?

I have a test repo that generates two simple .node libraries here: https://github.com/todbot/napi-demo
I can see that node-gyp is correctly building both:

$ ls -1 build/Release/*node
build/Release/hello1.node*
build/Release/hello2.node*

but prebuildify is only taking hello1.node and renaming it to node.napi.node, leaving hello2.node behind. And I don't see now in node-gyp-build I can specify which .node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions