Skip to content

Option to vendor binding files in top-level app?.. #67

@busticated

Description

@busticated

hey there 👋

thanks for the super-helpful lib 🙏

i'm looking for a way to "vendor" the binding files for my app such that dependencies (e.g. @serialport/bindings) use the vendor'ed bindings files provided by the root app instead of their module-local default. i don't see a way to do this - am i just missing it?

very roughly, you could:

  1. determine the app_root (perhaps via app-root-path)
  2. determine module_name (the package.json name field for the module - e.g. @serialport/bindings)
  3. add a lookup entry to the list here which is resolved first and attempts to load from a path like:
['app_root', 'vendor', 'module_name',  `abi-v${process.versions.modules}`, 'platform', 'arch', 'bindings']

...does that make sense and fit with your goals for this lib? happy to create a PR if so!

related: serialport/node-serialport#2044

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions