shibd commented on code in PR #239: URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011125781
########## README.md: ########## @@ -23,155 +23,80 @@ The Pulsar Node.js client can be used to create Pulsar producers and consumers in Node.js. -## Requirements - -Pulsar Node.js client library is based on the C++ client library. Follow the instructions for -[C++ library](https://pulsar.apache.org/docs/en/client-libraries-cpp/) for installing the binaries through -[RPM](https://pulsar.apache.org/docs/en/client-libraries-cpp/#rpm), -[Deb](https://pulsar.apache.org/docs/en/client-libraries-cpp/#deb) or -[Homebrew packages](https://pulsar.apache.org/docs/en/client-libraries-cpp/#macos). - -(Note: you will need to install not only the pulsar-client library but also the pulsar-client-dev library) - -Also, this library works only in Node.js 10.x or later because it uses the +This library works only in Node.js 10.x or later because it uses the [node-addon-api](https://github.com/nodejs/node-addon-api) module to wrap the C++ library. -## Compatibility - -Compatibility between each version of the Node.js client and the C++ client is as follows: - -| Node.js client | C++ client | -|----------------|-----------------| -| 1.0.x | 2.3.0 or later | -| 1.1.x | 2.4.0 or later | -| 1.2.x | 2.5.0 or later | -| 1.3.x | 2.7.0 or later | -| 1.4.x - 1.6.x | 2.8.0 or later | -| 1.7.x | 2.10.1 or later | - -If an incompatible version of the C++ client is installed, you may fail to build or run this library. - ## How to install -### Install on windows +> **Note** +> +> Only available for versions after 1.8.0. For versions before 1.8.0, you need to install the C++ client first, and switch to the corresponding version branch to view the specific steps. -1. Build the Pulsar C++ client on windows. +1. You can use `npm` or `yarn` to install `pulsar-client-node` ```shell -cmake \ - -A x64 \ - -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_TESTS=OFF \ - -DVCPKG_TRIPLET=x64-windows \ - -DCMAKE_BUILD_TYPE=Release \ - -S . -cmake --config Release +npm install pulsar-client +#or +yarn add pulsar-client ``` +2. Run Sample code -2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a Windows command tool. +Please refer to [examples](https://github.com/apache/pulsar-client-node/tree/master/examples). -```shell -# for example -set PULSAR_CPP_DIR=C:\pulsar\pulsar-client-cpp -``` -3. Set the variable `OS_ARCH` in a Windows command tool, `OS_ARCH` is related to the configuration of VCPKG_TRIPLET on the command line above.(Optional) +### Prebuilt binaries -```shell -set OS_ARCH=x64-windows -``` +The module uses [node-pre-gyp](https://github.com/mapbox/node-pre-gyp) to download the prebuilt binary for your platform, if it exists. +These binaries are hosted on ASF dist subversion. The following targets are currently provided: -### Install on mac +Format: `napi-{platform}-{libc}-{arch}` +- napi-darwin-unknown-x64.tar.gz +- napi-linux-glibc-arm64.tar.gz +- napi-linux-glibc-x64.tar.gz +- napi-linux-musl-arm64.tar.gz +- napi-linux-musl-x64.tar.gz +- napi-win32-unknown-ia32.tar.gz +- napi-win32-unknown-x64.tar.gz -1. Install the Pulsar C++ client on mac. +`darwin-arm64` systems are not currently supported, you can refer `How to build` to build from source. -```shell -brew install libpulsar -``` +## How to build -2. Get the installation path of libpulsar +To build from source, you need to install the CPP client first. Review Comment: agree, I removed this line. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
