Private package registry for Bun and Deno with JSR-style imports.
- JSR-style imports —
@scope/package@version/file.ts - Scoped tokens — Fine-grained access control per scope
- Symlinks mode — Local development without republishing
- Zero external services — SQLite + filesystem storage
- Lightweight — Single binary, minimal dependencies
bun add -g @r3rc/srce# Initialize registry (creates admin token)
srce init --data ./registry
# Start server
srce serve --port 4873 --data ./registry
# Login to registry
srce login http://localhost:4873 --token <admin-token>
# Publish a package
cd my-package
srce publishsrce serve [options]
--port <port> Port to listen on (default: 4873)
--data <dir> Data directory (default: ./data)
--symlinks <dir> Symlinks directory for local devsrce init [options]
--data <dir> Data directory (default: ./data)srce token create <name> [options]
--scopes <scopes> Comma-separated scopes (e.g. @r3/*,@internal/*)
--admin Create admin token
--data <dir> Data directory
srce token list [options]
srce token revoke <id> [options]srce list [options]
--registry <url> Registry URL (or use local mode)
--data <dir> Data directory for local mode
srce info <@scope/name> [options]
srce publish [options]
--registry <url> Registry URL
--token <token> Auth token
--dir <dir> Package directory (default: .)
srce deprecate <@scope/name@version> <message> [options]
srce undeprecate <@scope/name@version> [options]srce login <registry> [options]
--token <token> Auth token (or enter interactively)
srce logout
srce whoamiimport { something } from "http://localhost:4873/@scope/package@1.0.0/mod.ts";With import map:
{
"imports": {
"@scope/package": "http://localhost:4873/@scope/package@1.0.0/mod.ts"
}
}Configure bunfig.toml:
[install.scopes]
"@scope" = "http://localhost:4873"Then import normally:
import { something } from "@scope/package";Packages need a package.json with:
{
"name": "@scope/package",
"version": "1.0.0",
"exports": {
".": "./mod.ts",
"./utils": "./utils.ts"
}
}| Method | Endpoint | Description |
|---|---|---|
| GET | /@:scope/:name/meta.json |
Package metadata |
| GET | /@:scope/:name@:version/* |
File contents |
| GET | /api/packages |
List all packages |
| GET | /api/packages/@:scope/:name |
Package details |
| POST | /api/publish |
Publish package |
| PATCH | /api/packages/@:scope/:name/:version |
Deprecate version |
| DELETE | /api/packages/@:scope/:name/:version |
Delete version |
| GET | /api/tokens |
List tokens (admin) |
| POST | /api/tokens |
Create token (admin) |
| DELETE | /api/tokens/:id |
Delete token (admin) |
# Install dependencies
bun install
# Run dev server
bun run dev
# Lint
bun run lint
# Format
bun run fmt
# Type check
bun run checkFor local development without republishing:
srce serve --symlinks /path/to/packagesFiles are served from the symlinks directory, falling back to stored versions.
MIT