Self-hosted NPM registry, sealed in Rust.
A high-performance npm registry built with Rust and Rocket. Clef provides secure package hosting with intelligent upstream proxying, authentication, and caching—delivering the reliability and speed your development workflow demands.
Make sure you have rust and Node.JS installed on your system.
# Clone and build
git clone https://github.com/jkuri/clef.git
cd clef
make build-release
# Run with default settings
RUST_LOG=info ./target/release/clef
Set environment variables or use defaults:
export CLEF_HOST=127.0.0.1 # Default: 127.0.0.1
export CLEF_PORT=8000 # Default: 8000
export CLEF_UPSTREAM_REGISTRY=https://registry.npmjs.org # Default
export CLEF_DATABASE_URL=./data/clef.db # Default
Run with Docker.
docker run -it --rm -p 8000:8000 -v ./data:/app/data jkuri/clef:latest
# Configure registry
npm config set registry http://localhost:8000/registry
# Login (creates account if needed)
npm login --registry http://localhost:8000/registry
# Publish package
npm publish
# Install packages
npm install my-package
npm install @myorg/my-scoped-package
# Configure registry
yarn config set registry http://localhost:8000/registry
# Login
yarn login --registry http://localhost:8000/registry
# Publish
yarn publish
# Install
yarn add my-package
yarn add @myorg/my-scoped-package
# Configure registry
pnpm config set registry http://localhost:8000/registry
# Login
pnpm login --registry http://localhost:8000/registry
# Publish
pnpm publish
# Install
pnpm add my-package
pnpm add @myorg/my-scoped-package
Create .npmrc in your project root:
registry=http://localhost:8000/registry
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run
# Database migrations
diesel migration run



MIT License - see LICENSE for details.
Content type
Image
Digest
sha256:eb09c0a5a…
Size
14.9 MB
Last updated
about 1 year ago
docker pull jkuri/clef