Skip to content

Expose napi version as a node-gyp variable #1745

@josephg

Description

@josephg

For my module I want to do conditional compilation based on node-gyp feature support.

Unfortunately there's currently no nice way to figure out at node-gyp configuration time which napi version is supported. I'm currently doing this:

  'variables': {
    'napi_version': '<!(node -e "console.log(process.versions.napi)")',
  },

But this checks napi support in the host version of nodejs, not in the nodejs build target version.

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