Building nodejs
bindings requires some extra setup.
For small or first-time contributions, we recommend the dev container method. Prefer to do it yourself? That's fine too!
OpenDAL provides a pre-configured dev container that could be used in Github Codespaces, VSCode, JetBrains, JuptyerLab. Please pick up your favourite runtime environment.
The fastest way is:
The nodejs
binding requires Node.js@16+
to be built. We recommend using the latest TLS version for development.
OpenDAL provides a .node-version
file that specifies the recommended node versions. You can use any compatible tool to install the correct node version, such as fnm.
Alternatively, you can manually install the LTS node by following these steps:
For Ubuntu and Debian:
> curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs
For RHEL, CentOS, CloudLinux, Amazon Linux or Fedora:
> curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
Afterwards, you will need to enable corepack
to ensure that yarn
has been set up correctly:
> sudo corepack enable
To verify that everything is working properly, run yarn --version
:
> yarn --version
3.4.1
# Install dependencies.
> yarn
# Build from source.
> yarn build
# Build from source with debug info.
> yarn build:debug
We use Cucumber
for behavior testing. Refer to here for more information about Cucumber
.
> yarn test
............
2 scenarios (2 passed)
12 steps (12 passed)
0m00.055s (executing steps: 0m00.004s)