You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/31 06:35:23 UTC

[GitHub] [pulsar-client-node] shibd opened a new pull request, #239: [refactor] Modify the README to apply the new installation method

shibd opened a new pull request, #239:
URL: https://github.com/apache/pulsar-client-node/pull/239

   ### Motivation
   
   #235 and #238 support downloading prebuilt binary when `npm install`. This simplifies installation for users. 
   
   ### Modifications
   - Modify the README to apply the new install and build method.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [ ] `doc-not-needed` 
   (Please explain why)
   
   - [x] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
shibd commented on PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#issuecomment-1296604928

   @merlimat @massakam @AnonHxy Can you take a look? Thanks.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] BewareMyPower merged pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
BewareMyPower merged PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] tisonkun commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
tisonkun commented on code in PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011091771


##########
pkg/mac/common.sh:
##########
@@ -19,7 +19,10 @@
 
 set -e -x
 
-export ARCH=${ARCH:-arm64}
+if [ ! -n "$ARCH" ]; then

Review Comment:
   ```suggestion
   if [ -z "$ARCH" ]; then
   ```
   
   Prefer positive condition to double negative condition.



##########
pkg/mac/common.sh:
##########
@@ -19,7 +19,10 @@
 
 set -e -x
 
-export ARCH=${ARCH:-arm64}
+if [ ! -n "$ARCH" ]; then
+   export ARCH=$(uname -m)

Review Comment:
   Shall we normalize the output as:
   
   ```shell
   $(uname -m | sed -r 's/aarch64/arm64/g' |  awk '!/arm64/{$0="amd64"}1')
   ```
   
   ?



##########
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:
   ```suggestion
   ```
   
   Already reflected in step 2. If you write this line followed "clone repository", it reads confusing.



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.

Review Comment:
   ```suggestion
   Select the appropriate installation method from below depending on your operating system:
   ```



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac
 ```shell
-# for example
-## Intel x86_64
-export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
-
-## Apple Silicon and Homebrew since 3.0.0
-## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
-export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/2.9.1_1
-```
-
-### Install on Linux
-
-1. Require g++ and make commands to install pulsar-client
+$ pkg/mac/build-cpp-deps-lib.sh
+$ pkg/mac/build-cpp-lib.sh
 ```
-# rpm
-$ yum install gcc-c++ make
 
-# debian
-$ apt-get install g++ make
-```
-
-2. Download rpm or debian packages.
-```
-# Set the version of Pulsar C++ client to install
-$ PULSAR_CPP_CLIENT_VERSION=2.9.1
-
-# rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-devel-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-
-# debian
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb
-```
-
-3. Install the Pulsar C++ client.
+Install c++ client on Linux
 ```shell
-# rpm
-$ rpm -ivh apache-pulsar-client*.rpm
-
-# debian
-$ apt install ./apache-pulsar-client*.deb
+$ build-support/install-cpp-client.sh
 ```
 
-
-### Install pulsar-client to your project
-
+Install c++ client on Windows(Need install curl and 7z first)
 ```shell
-$ npm install pulsar-client
+$ pkg\windows\download-cpp-client.bat
 ```
 
-## Sample code
-
-Please refer to [examples](https://github.com/apache/pulsar-client-node/tree/master/examples).
-
-## How to build
-
-### Install dependent npm modules and build Pulsar client library:
+3. Build NAPI from source.

Review Comment:
   I may suggest you use `### 3. Build NAPI from source` and ditto other steps, since step 2 is relatively complex.



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.

Review Comment:
   ```suggestion
   2. Install C++ client.
   ```
   
   Keep consistency to refer `C++`.



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac
 ```shell
-# for example
-## Intel x86_64
-export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
-
-## Apple Silicon and Homebrew since 3.0.0
-## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
-export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/2.9.1_1
-```
-
-### Install on Linux
-
-1. Require g++ and make commands to install pulsar-client
+$ pkg/mac/build-cpp-deps-lib.sh
+$ pkg/mac/build-cpp-lib.sh
 ```
-# rpm
-$ yum install gcc-c++ make
 
-# debian
-$ apt-get install g++ make
-```
-
-2. Download rpm or debian packages.
-```
-# Set the version of Pulsar C++ client to install
-$ PULSAR_CPP_CLIENT_VERSION=2.9.1
-
-# rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-devel-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-
-# debian
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb
-```
-
-3. Install the Pulsar C++ client.
+Install c++ client on Linux
 ```shell
-# rpm
-$ rpm -ivh apache-pulsar-client*.rpm
-
-# debian
-$ apt install ./apache-pulsar-client*.deb
+$ build-support/install-cpp-client.sh
 ```
 
-
-### Install pulsar-client to your project
-
+Install c++ client on Windows(Need install curl and 7z first)
 ```shell
-$ npm install pulsar-client
+$ pkg\windows\download-cpp-client.bat
 ```
 
-## Sample code
-
-Please refer to [examples](https://github.com/apache/pulsar-client-node/tree/master/examples).
-
-## How to build
-
-### Install dependent npm modules and build Pulsar client library:
+3. Build NAPI from source.
 
 ```shell
-$ git clone https://github.com/apache/pulsar-client-node.git
-$ cd pulsar-client-node
-$ npm install
+npm install --build-from-source 
 ```
 
-> **Note**
->
-> If you build `pulsar-client-node on` windows, you need to set the variable `PULSAR_CPP_DIR` first, then install npm (run the command `npm install`) in a Windows command-line tool.
-
-### Rebuild Pulsar client library:
-
-```shell
-$ npm run build
-```
 
 ## Documentation
 * Please see https://pulsar.apache.org/docs/en/client-libraries-node for more details about the Pulsar Node.js client.  

Review Comment:
   ```suggestion
   * Please see https://pulsar.apache.org/docs/client-libraries-node/ for more details about the Pulsar Node.js client.  
   ```
   
   Use a concise URL.



##########
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

Review Comment:
   Why do we write this section? Shall we move it to the "How to build" chapter?



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac

Review Comment:
   ```suggestion
   Install C++ client on macOS:
   ```



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git

Review Comment:
   Keep consistency not to use `$`.



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git

Review Comment:
   ```suggestion
   git clone https://github.com/apache/pulsar-client-node.git
   ```
   
   ditto others.



##########
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`

Review Comment:
   Now we don't need to use multiple steps. I suggest keeping only the install instructions:
   
   ````diff
   diff --git a/README.md.old b/README.md
   index 2f781c9..fbb4d2f 100644
   --- a/README.md.old
   +++ b/README.md
   @@ -32,18 +32,19 @@ This library works only in Node.js 10.x or later because it 
   uses the
    >
    > 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. You can use `npm` or `yarn` to install `pulsar-client-node`
   +### `npm`
    
    ```shell
    npm install pulsar-client
   -#or
   -yarn add pulsar-client
    ```
    
   -2. Run Sample code
   +### `yarn`
    
   -Please refer to [examples](https://github.com/apache/pulsar-client-node/tree/master/examples).
   +```shell
   +yarn add pulsar-client
   +```
    
   +After install, you can run the [examples](https://github.com/apache/pulsar-client-node/tree/master/examples).
    
    ### Prebuilt binaries
   ````



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac
 ```shell
-# for example
-## Intel x86_64
-export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
-
-## Apple Silicon and Homebrew since 3.0.0
-## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
-export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/2.9.1_1
-```
-
-### Install on Linux
-
-1. Require g++ and make commands to install pulsar-client
+$ pkg/mac/build-cpp-deps-lib.sh
+$ pkg/mac/build-cpp-lib.sh
 ```
-# rpm
-$ yum install gcc-c++ make
 
-# debian
-$ apt-get install g++ make
-```
-
-2. Download rpm or debian packages.
-```
-# Set the version of Pulsar C++ client to install
-$ PULSAR_CPP_CLIENT_VERSION=2.9.1
-
-# rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-devel-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-
-# debian
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb
-```
-
-3. Install the Pulsar C++ client.
+Install c++ client on Linux

Review Comment:
   ```suggestion
   Install C++ client on Linux:
   ```



##########
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.

Review Comment:
   ```suggestion
   > These instructions are only available for versions after 1.8.0. For versions previous to 1.8.0, you need to install the C++ client first. Please switch to the corresponding version branch of this repo to read the specific instructions.
   ```



##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac
 ```shell
-# for example
-## Intel x86_64
-export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
-
-## Apple Silicon and Homebrew since 3.0.0
-## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
-export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/2.9.1_1
-```
-
-### Install on Linux
-
-1. Require g++ and make commands to install pulsar-client
+$ pkg/mac/build-cpp-deps-lib.sh
+$ pkg/mac/build-cpp-lib.sh
 ```
-# rpm
-$ yum install gcc-c++ make
 
-# debian
-$ apt-get install g++ make
-```
-
-2. Download rpm or debian packages.
-```
-# Set the version of Pulsar C++ client to install
-$ PULSAR_CPP_CLIENT_VERSION=2.9.1
-
-# rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-devel-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-
-# debian
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb
-```
-
-3. Install the Pulsar C++ client.
+Install c++ client on Linux
 ```shell
-# rpm
-$ rpm -ivh apache-pulsar-client*.rpm
-
-# debian
-$ apt install ./apache-pulsar-client*.deb
+$ build-support/install-cpp-client.sh
 ```
 
-
-### Install pulsar-client to your project
-
+Install c++ client on Windows(Need install curl and 7z first)

Review Comment:
   ```suggestion
   Install C++ client on Windows (required preinstall `curl` and `7z`):
   ```



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
shibd commented on code in PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011122431


##########
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`

Review Comment:
   oh, Let us only keep `npm`.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
shibd commented on code in PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011126334


##########
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

Review Comment:
   This is a simple introduction to the principle, and I should put it before `How to install` section.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
shibd commented on code in PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011125547


##########
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.
 
+1. Clone repository.
 ```shell
-brew info libpulsar
+$ git clone https://github.com/apache/pulsar-client-node.git
+$ cd pulsar-client-node
 ```
 
+2. Install CPP client.
 
-2. Set the variable `PULSAR_CPP_DIR` with the `pulsar-client-cpp` path in a mac command tool.
+Select the appropriate installation method from below depending on your operating system.
 
+Install c++ client on mac
 ```shell
-# for example
-## Intel x86_64
-export PULSAR_CPP_DIR=/usr/local/Cellar/libpulsar/2.9.1_1
-
-## Apple Silicon and Homebrew since 3.0.0
-## cf. https://brew.sh/2021/02/05/homebrew-3.0.0/
-export PULSAR_CPP_DIR=/opt/homebrew/Cellar/libpulsar/2.9.1_1
-```
-
-### Install on Linux
-
-1. Require g++ and make commands to install pulsar-client
+$ pkg/mac/build-cpp-deps-lib.sh
+$ pkg/mac/build-cpp-lib.sh
 ```
-# rpm
-$ yum install gcc-c++ make
 
-# debian
-$ apt-get install g++ make
-```
-
-2. Download rpm or debian packages.
-```
-# Set the version of Pulsar C++ client to install
-$ PULSAR_CPP_CLIENT_VERSION=2.9.1
-
-# rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/RPMS/apache-pulsar-client-devel-${PULSAR_CPP_CLIENT_VERSION}-1.x86_64.rpm
-
-# debian
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb
-$ wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb
-```
-
-3. Install the Pulsar C++ client.
+Install c++ client on Linux
 ```shell
-# rpm
-$ rpm -ivh apache-pulsar-client*.rpm
-
-# debian
-$ apt install ./apache-pulsar-client*.deb
+$ build-support/install-cpp-client.sh
 ```
 
-
-### Install pulsar-client to your project
-
+Install c++ client on Windows(Need install curl and 7z first)
 ```shell
-$ npm install pulsar-client
+$ pkg\windows\download-cpp-client.bat
 ```
 
-## Sample code
-
-Please refer to [examples](https://github.com/apache/pulsar-client-node/tree/master/examples).
-
-## How to build
-
-### Install dependent npm modules and build Pulsar client library:
+3. Build NAPI from source.

Review Comment:
   adopt



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-node] shibd commented on a diff in pull request #239: [refactor] Modify the README to apply the new installation method

Posted by GitBox <gi...@apache.org>.
shibd commented on code in PR #239:
URL: https://github.com/apache/pulsar-client-node/pull/239#discussion_r1011120571


##########
pkg/mac/common.sh:
##########
@@ -19,7 +19,10 @@
 
 set -e -x
 
-export ARCH=${ARCH:-arm64}
+if [ ! -n "$ARCH" ]; then
+   export ARCH=$(uname -m)

Review Comment:
   There is no need, this script is only used on Mac systems.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org