0.2.0-beta.1 • Published 3 years ago

rgblib v0.2.0-beta.1

Weekly downloads
4
License
MIT
Repository
-
Last release
3 years ago

Node.js bindings

Build

In order to build Node.js bindings, from the project root follow the Local or In docker instructions.

Both instructions will generate the files librgb.so in rust-lib/target/release/ and rgb.node in bindings/nodejs/build/Release/.

Local

  • Install dependencies: Node.js v10, node-gyp, swig 4.0
  • From the project root run:
cd bindings/npm
npm install

In docker

docker build -f bindings/npmnpm/Dockerfile -t rgb-sdk-npm .
docker run --rm -v $(pwd):/opt/mount --entrypoint bash \
    rgb-sdk-npm \
    -c 'mkdir -p /opt/mount/librgb/target/release /opt/mount/bindings/npm/build/Release \
    && cp /rgb-sdk/target/release/librgb.so /opt/mount/librgb/target/release/librgb.so \
    && cp /rgb-sdk/rgb.node /opt/mount/bindings/npm/build/Release/rgb.node'

Usage

To try the generated library, you can use: