Skip to content

Enforce NAPI version in module headers #286

Closed
@kfarnung

Description

@kfarnung

As discussed today it seems like rather than having developers declare their version specifically it would make sense to enforce it in the header file.

By default only the first version would be exposed and the developer can explicitly opt in using a preprocessor directive:

#define NAPI_VERSION  2
#include <node_api.h>

I've made the required changes in a private branch to start the discussion. If there are no objections I can go ahead and open a PR in the main repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions