This repository contains tools and example configuration for Chainguard Libraries for JavaScript.
The focus is on showing how to configure the common JavaScript package managers
to consume Chainguard Libraries directly from libraries.cgr.dev.
Each package manager has its own folder with a demo.sh script and a README.
The script creates a fresh throwaway project, applies that manager's registry
and authentication configuration, and installs a couple of packages so you can
confirm they resolve through Chainguard Libraries. The projects are hollow
shells with no application code — they exist only to prove the configuration
and dependency resolution work, but the config steps are a faithful template
for a real project.
| Folder | Package manager |
|---|---|
tools |
Shared access setup — chainctl commands and authentication, the same for every package manager |
npm |
npm |
pnpm |
pnpm |
yarn-berry |
Yarn Berry (v4+) |
yarn-classic |
Yarn Classic (v1) |
bun |
Bun |
- A Chainguard account with a JavaScript libraries entitlement
chainctlinstalled and authenticated- Node.js (current LTS) and the package manager you want to try
Set up access with the chainctl commands and authentication notes in
tools. Creating an entitlement and a pull token is
identical across package managers; only the per-tool registry configuration
differs, and that lives with each package manager's folder.
Once a pull token is exported into your shell:
eval "$(chainctl auth pull-token --output env --repository=javascript)"run any package manager's demo, for example:
./npm/demo.shSee each package manager's folder README for the per-tool configuration details and how to swap in your own dependencies to test.
These examples all use direct access to libraries.cgr.dev/javascript/. If your
organization fronts Chainguard Libraries with a repository manager (Nexus,
Artifactory, Cloudsmith, Harbor, Amazon ECR, or Google Artifact Registry)
instead, see Repository managers and the
global configuration docs.
- Chainguard Libraries product page
- Chainguard Libraries documentation
- Chainguard Libraries for JavaScript documentation
- Chainguard Libraries for JavaScript — global configuration
- Chainguard Libraries for JavaScript — build configuration — the "Minimal example project" sections each
demo.shimplements - Chainguard learning labs with more demos
- Chainguard Libraries for Java examples
- Chainguard Libraries for Python examples