Skip to content

Mention vcpkg port in docs #46641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 13 additions & 0 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ developers have run into limitations in node-gyp.
CMake.js is a good choice for projects that already use CMake or for
developers affected by limitations in node-gyp.

#### vcpkg

For vcpkg users there are node-api and node-addon-api ports that can be
installed by the following commands.

```bash
vcpkg install node-api
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find these packages on https://vcpkg.io/en/packages.html and I'm not aware of an existing release process that publishes these packages.

@mhdawson please correct me if I'm missing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these are referencing the ports added by:

Yeah, that's true. I'm not sure what revision of vcpkg does the site use, but those packages are available for users.

Unlike many package managers vcpkg consists of build recipes instead of storing files in the cloud. Those build recipes are being maintained by the community and Microsoft.

The usual workflow is to have vcpkg repo cloned somewhere on your machine. So, once you cloned latest vcpkg or pulled latest changes, you'd be able to run vcpkg install node-api and vcpkg install node-addon-api.

After running those commands you can see a brief explanation on how to use node-api/node-addon-api with your existing CMake project (and some CMake lines to copy-paste).

vcpkg install node-addon-api
```

This feature is beneficial for existing projects using [CMake][], as it
enables you to develop native modules for Node.js without relying on npm.

### Uploading precompiled binaries

The three tools listed here permit native addon developers and maintainers
Expand Down