See CONTRIBUTING.md.
To build libdatadog-nodejs locally (for example, to run tests or try out changes), you need Node.js, Yarn, and Rust.
Rust (required for native and WASM builds)
The project compiles Rust for both native Node.js addons and WebAssembly. Use rustup (the recommended and supported method):
-
Install rustup and Rust (see https://rustup.rs/ for more options):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Ensure Rust is on
PATH— the rustup installer prints the command for your shell; run it or open a new terminal. -
Add the WebAssembly target (required for the full build):
rustup target add wasm32-unknown-unknown
-
On macOS only — the WASM build requires LLVM from Homebrew (Apple's Clang has compatibility issues with some crates). Install it before building:
brew install llvm
-
Install dependencies:
yarn install
yarn build: Build the default workspaces in debug mode.yarn build-release: Build the default workspaces in release mode.yarn build-all: Build all workspaces in debug mode. This is useful when working on a workspace that is not a default member yet.
yarn test: Run the JavaScript test suite