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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to