Node.js SDK
RBS provides hermetic Node.js support with automatic runtime management, npm-compatible package resolution, and zero reliance on thenpm or yarn CLI. RBS fetches and caches all packages directly.
Setup
Toolchain
Register a Node.js toolchain inWORKSPACE.rbs:
Dependencies
Define npm packages usingnodejs_repository. RBS resolves semver ranges and downloads all transitive dependencies.
RBS manages npm packages directly — no
npm, yarn, or pnpm CLI is ever invoked. All packages are hermetically cached in .rbs/external-deps/.Rules
nodejs_library
Creates a reusable Node.js library.
nodejs_binary
Creates an executable Node.js application.
nodejs_test
Runs Node.js tests.
Example: Express API
- WORKSPACE.rbs
- BUILD.rbs
- Commands