The open-source package registry for modern JavaScript and TypeScript
2,973
stars
641
commits
Rust
primary language
Sep 4, 2026
updated
This is the source code for https://jsr.io, the new JavaScript registry.
[!IMPORTANT] The rest of this README is only relevant to those interested in contributing to the jsr.io registry. If you are looking for information on how to use the registry, please see https://jsr.io/docs.
Goals
Implementation details
For a detailed breakdown of the system, see architecture.md.
If you are just interested in making changes to the frontend, you can run the frontend in a development mode that connects to the production API.
Run the frontend setup to add the required /etc/hosts entries:
deno task dev setup frontend
deno task prod:frontendYou can view the registry at http://jsr.test. This frontend is connected to
the production API - use it with the same care that you would use the live
registry.
In this mode, you will run the frontend and the API locally. This is useful for making changes to the API.
Clone this repo
Install Deno (https://deno.com)
Install Rust (https://rustup.rs/)
On Linux: install docker & docker-compose
On macOS: install PostgreSQL (brew install postgresql)
Install sqlx by running cargo install sqlx-cli
Set up api/.env file:
.env file from 1Password (it's
named jsr local .env), and set up DATABASE_URL to point to your local
Postgres database.api/.env.example to api/.envGITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET to the values from the
GitHub App you created in step 1.DATABASE_URL to point to your local Postgres database.Run the setup command to verify prerequisites, configure /etc/hosts, create
the database, and run migrations:
deno task dev setup
This will:
jsr.test, api.jsr.test, and npm.jsr.test to /etc/hosts (and the
Windows hosts file if running under WSL)api/.env.example to api/.env if it doesn't existregistry database and run migrationsStart all services, the API, and the frontend in a single terminal:
deno task dev
On Linux, if you manage PostgreSQL outside of Docker:
deno task dev --no-docker-postgres
While running, type commands into the prompt at the bottom:
restart <name|all> - restart a process (or all)help - show available commandsquit / Ctrl+C - shutdown all and exitYou can also run a single service standalone:
deno task dev start <name> [args...]
You can view the registry at http://jsr.test. The API can be found at
http://api.jsr.test.
deno.jsoncd into that directoryJSR_URL=http://jsr.test deno publishIt may be helpful to have a large variety of packages published to your local dev environment to simulate a live environment. The quickest way to fill the registry with data is to publish deno_std to the registry. This can be done via the following steps:
std scope to your user through the
admin panel by using the UUID from the
previous step.jsr project.JSR_URL=http://jsr.test deno publish to publish all of the @std
packages to your local dev environment.psql registrySELECT name, github_id FROM users;UPDATE users SET is_staff = true WHERE github_id = xxxxxxx;, replacing
xxxxxxx with your copied GitHub ID from the previous step.When the database schema has been changed, you can migrate the local database by running this command:
deno task db:migrate
To load bad words into the database:
cloud-sql-proxy -g [database connection string] -p 5433bad_words.sql file, with the contents as:INSERT INTO bad_words (word) VALUES
('word_1'),
-- more words
('word_2');
psql postgres://127.0.0.1:5433/registry --user [your username] -f bad_words.sql,
and provide the password for the provided username.The documentation generation is done via
deno_doc.
To be able to use a local deno_doc clone in jsr, you need to add this to the
root Cargo.toml in this repository:
[patch.crates-io]
deno_doc = { path = "../deno_doc" }
Please make sure that the version of deno_doc you have locally is the same
version as the one referenced in api/Cargo.toml, else the patching will not
work.
Please open PRs in the deno_doc repository when it is changes that should
affect the overall documentation generation system, even if it is only for css
changes, with a few minor exceptions when the css changes are related to the
integration and layouting specific for jsr alone.
For more information on how the HTML documentation generation works and how to
locally work on it, please see the
HTML development section
of deno_doc.
The db:switch tool lets you work on multiple branches without clobbering your
main development database. Each branch gets its own PostgreSQL database.
deno task db:switch switch # switch to branch db copied from main
deno task db:switch empty # switch to an empty branch db
deno task db:switch main # switch back to the main database
deno task db:switch current # show which database is active
deno task db:switch list # list all branch databases
deno task db:switch clean # drop all branch databases
The switch and empty commands write an api/.env.local override file. Use
--method=export to print an export command instead.
During local dev, traces are sent to Jaeger. You can view them at
http://localhost:16686. You can find traces in API HTTP requests by inspecting
the x-deno-ray header.
(top 30 of 96)
Rust
57.3%
TypeScript
37.2%
HCL
2.8%
CSS
1.6%
The open-source package registry for modern JavaScript and TypeScript
2,973
stars
641
commits
Rust
primary language
Sep 4, 2026
updated
This is the source code for https://jsr.io, the new JavaScript registry.
[!IMPORTANT] The rest of this README is only relevant to those interested in contributing to the jsr.io registry. If you are looking for information on how to use the registry, please see https://jsr.io/docs.
Goals
Implementation details
For a detailed breakdown of the system, see architecture.md.
If you are just interested in making changes to the frontend, you can run the frontend in a development mode that connects to the production API.
Run the frontend setup to add the required /etc/hosts entries:
deno task dev setup frontend
deno task prod:frontendYou can view the registry at http://jsr.test. This frontend is connected to
the production API - use it with the same care that you would use the live
registry.
In this mode, you will run the frontend and the API locally. This is useful for making changes to the API.
Clone this repo
Install Deno (https://deno.com)
Install Rust (https://rustup.rs/)
On Linux: install docker & docker-compose
On macOS: install PostgreSQL (brew install postgresql)
Install sqlx by running cargo install sqlx-cli
Set up api/.env file:
.env file from 1Password (it's
named jsr local .env), and set up DATABASE_URL to point to your local
Postgres database.api/.env.example to api/.envGITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET to the values from the
GitHub App you created in step 1.DATABASE_URL to point to your local Postgres database.Run the setup command to verify prerequisites, configure /etc/hosts, create
the database, and run migrations:
deno task dev setup
This will:
jsr.test, api.jsr.test, and npm.jsr.test to /etc/hosts (and the
Windows hosts file if running under WSL)api/.env.example to api/.env if it doesn't existregistry database and run migrationsStart all services, the API, and the frontend in a single terminal:
deno task dev
On Linux, if you manage PostgreSQL outside of Docker:
deno task dev --no-docker-postgres
While running, type commands into the prompt at the bottom:
restart <name|all> - restart a process (or all)help - show available commandsquit / Ctrl+C - shutdown all and exitYou can also run a single service standalone:
deno task dev start <name> [args...]
You can view the registry at http://jsr.test. The API can be found at
http://api.jsr.test.
deno.jsoncd into that directoryJSR_URL=http://jsr.test deno publishIt may be helpful to have a large variety of packages published to your local dev environment to simulate a live environment. The quickest way to fill the registry with data is to publish deno_std to the registry. This can be done via the following steps:
std scope to your user through the
admin panel by using the UUID from the
previous step.jsr project.JSR_URL=http://jsr.test deno publish to publish all of the @std
packages to your local dev environment.psql registrySELECT name, github_id FROM users;UPDATE users SET is_staff = true WHERE github_id = xxxxxxx;, replacing
xxxxxxx with your copied GitHub ID from the previous step.When the database schema has been changed, you can migrate the local database by running this command:
deno task db:migrate
To load bad words into the database:
cloud-sql-proxy -g [database connection string] -p 5433bad_words.sql file, with the contents as:INSERT INTO bad_words (word) VALUES
('word_1'),
-- more words
('word_2');
psql postgres://127.0.0.1:5433/registry --user [your username] -f bad_words.sql,
and provide the password for the provided username.The documentation generation is done via
deno_doc.
To be able to use a local deno_doc clone in jsr, you need to add this to the
root Cargo.toml in this repository:
[patch.crates-io]
deno_doc = { path = "../deno_doc" }
Please make sure that the version of deno_doc you have locally is the same
version as the one referenced in api/Cargo.toml, else the patching will not
work.
Please open PRs in the deno_doc repository when it is changes that should
affect the overall documentation generation system, even if it is only for css
changes, with a few minor exceptions when the css changes are related to the
integration and layouting specific for jsr alone.
For more information on how the HTML documentation generation works and how to
locally work on it, please see the
HTML development section
of deno_doc.
The db:switch tool lets you work on multiple branches without clobbering your
main development database. Each branch gets its own PostgreSQL database.
deno task db:switch switch # switch to branch db copied from main
deno task db:switch empty # switch to an empty branch db
deno task db:switch main # switch back to the main database
deno task db:switch current # show which database is active
deno task db:switch list # list all branch databases
deno task db:switch clean # drop all branch databases
The switch and empty commands write an api/.env.local override file. Use
--method=export to print an export command instead.
During local dev, traces are sent to Jaeger. You can view them at
http://localhost:16686. You can find traces in API HTTP requests by inspecting
the x-deno-ray header.
(top 30 of 96)
Rust
57.3%
TypeScript
37.2%
HCL
2.8%
CSS
1.6%