Fix windows default download cpp client failed. (#257)

### Motivation
https://github.com/apache/pulsar-client-node/issues/256

### Modifications

- Get local `arch` when the `arch` is empty.
- Use `move` instead of `mv`
1 file changed
tree: 6566132cc15f30eb037a994401b331b2c97f33eb
  1. .github/
  2. build-support/
  3. docs/
  4. examples/
  5. perf/
  6. pkg/
  7. src/
  8. tests/
  9. .asf.yaml
  10. .clang-format
  11. .eslintignore
  12. .eslintrc.json
  13. .gitignore
  14. binding.gyp
  15. dependencies.yaml
  16. Gruntfile.js
  17. index.d.ts
  18. index.js
  19. LICENSE
  20. license-header.txt
  21. package-lock.json
  22. package.json
  23. pulsar-client-cpp-version.txt
  24. README.md
  25. tsconfig.json
  26. tslint.json
  27. tstest.ts
README.md

Pulsar Node.js client library

The Pulsar Node.js client can be used to create Pulsar producers and consumers in Node.js.

This library works only in Node.js 10.x or later because it uses the node-addon-api module to wrap the C++ library.

How to install

Note

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.

Use npm

npm install pulsar-client

Use yarn

yarn add pulsar-client

After install, you can run the examples.

Prebuilt binaries

The module uses 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:

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

darwin-arm64 systems are not currently supported, you can refer How to build to build from source.

How to build

1. Clone repository.

git clone https://github.com/apache/pulsar-client-node.git
cd pulsar-client-node

2. Install C++ client.

Select the appropriate installation method from below depending on your operating system:

Install C++ client on macOS:

pkg/mac/build-cpp-deps-lib.sh
pkg/mac/build-cpp-lib.sh

Install C++ client on Linux:

build-support/install-cpp-client.sh

Install C++ client on Windows (required preinstall curl and 7z):

pkg\windows\download-cpp-client.bat

3. Build NAPI from source

npm install --build-from-source 

Documentation