[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73322":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},73322,"jsr","jsr-io\u002Fjsr","jsr-io","The open-source package registry for modern JavaScript and TypeScript","https:\u002F\u002Fjsr.io",null,"Rust",2951,171,14,264,0,3,4,19,9,28.71,"MIT License",false,"main",[26,27,28],"javascript","registry","typescript","2026-06-12 02:03:11","# jsr.io\n\n\u003Cimg src=\".\u002Ffrontend\u002Fstatic\u002Flogo.png\" width=\"200\" align=\"right\" alt=\"the jsr logo\">\n\nThis is the source code for https:\u002F\u002Fjsr.io, the new JavaScript registry.\n\n\u003C!--deno-fmt-ignore-start-->\n> [!IMPORTANT]\n> The rest of this README is only relevant to those interested in contributing\n> to the jsr.io registry. If you are looking for information on how to use the\n> registry, please see https:\u002F\u002Fjsr.io\u002Fdocs.\n\u003C!--deno-fmt-ignore-end-->\n\n## Project Information\n\n[![OpenSSF Scorecard](https:\u002F\u002Fapi.scorecard.dev\u002Fprojects\u002Fgithub.com\u002Fjsr-io\u002Fjsr\u002Fbadge)](https:\u002F\u002Fscorecard.dev\u002Fviewer\u002F?uri=github.com\u002Fjsr-io\u002Fjsr)\n\n**Goals**\n\n- Robust\n- Low maintenance\n- Cheap\n- Open source\n\n**Implementation details**\n\n- Modules and package metadata are stored on Cloudflare R2\n- npm compatibility tarballs are stored on Cloudflare R2\n- Management API is implemented in Rust and runs on Google Cloud Run\n- Frontend uses Fresh and is running on Google Cloud Run\n- https:\u002F\u002Fjsr.io, https:\u002F\u002Fapi.jsr.io, and https:\u002F\u002Fnpm.jsr.io are served by a\n  Cloudflare Workers worker\n  - Module, package metadata, and npm tarballs are served directly from R2\n  - \u002Fapi requests are proxied to the management API\n  - All other requests are proxied to the frontend\n- Data is stored in PostgreSQL (using Google Cloud SQL)\n  - The database is highly available\n  - Not used for serving registry requests\n- Search powered by Orama\n- Distributed tracing using Google Cloud Trace (and Jaeger in development)\n\nFor a detailed breakdown of the system, see\n[architecture.md](.\u002Farchitecture.md).\n\n## Getting started (frontend only)\n\nIf you are just interested in making changes to the frontend, you can run the\nfrontend in a development mode that connects to the production API.\n\n### Prerequisites\n\n- Clone this repo\n- Install Deno (https:\u002F\u002Fdeno.com)\n\n### Setup\n\nRun the frontend setup to add the required `\u002Fetc\u002Fhosts` entries:\n\n```sh\ndeno task dev setup frontend\n```\n\n### Running jsr\n\n1. `deno task prod:frontend`\n\nYou can view the registry at `http:\u002F\u002Fjsr.test`. This frontend is connected to\nthe production API - use it with the same care that you would use the live\nregistry.\n\n## Getting started (entire stack)\n\nIn this mode, you will run the frontend and the API locally. This is useful for\nmaking changes to the API.\n\n### Prerequisites\n\n- Clone this repo\n- Install Deno (https:\u002F\u002Fdeno.com)\n- Install Rust (https:\u002F\u002Frustup.rs\u002F)\n- On Linux: install `docker` & `docker-compose`\n- On macOS: install PostgreSQL (`brew install postgresql`)\n- Install `sqlx` by running `cargo install sqlx-cli`\n\n- Set up `api\u002F.env` file:\n  - For **@denoland employees**: Download the `.env` file from 1Password (it's\n    named `jsr local .env`), and set up `DATABASE_URL` to point to your local\n    Postgres database.\n  - For **everyone else**:\n    1. Create a GitHub App (https:\u002F\u002Fgithub.com\u002Fsettings\u002Fapps\u002Fnew)\n       - Callback URL: \"http:\u002F\u002Fjsr.test\u002Flogin\u002Fcallback\"\n       - Check \"Request user authorization (OAuth) during installation\"\n       - Disable \"Webhook\"\n       - Set \"Account permissions\" > \"Email addresses\" to \"Read-only\"\n    2. Copy `api\u002F.env.example` to `api\u002F.env`\n    3. Set `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` to the values from the\n       GitHub App you created in step 1.\n    4. Set `DATABASE_URL` to point to your local Postgres database.\n\n### Setup\n\nRun the setup command to verify prerequisites, configure `\u002Fetc\u002Fhosts`, create\nthe database, and run migrations:\n\n```sh\ndeno task dev setup\n```\n\nThis will:\n\n- Check that all required tools are installed (Deno, Cargo, sqlx,\n  Docker\u002FPostgres)\n- Add `jsr.test`, `api.jsr.test`, and `npm.jsr.test` to `\u002Fetc\u002Fhosts` (and the\n  Windows hosts file if running under WSL)\n- Install frontend dependencies\n- Copy `api\u002F.env.example` to `api\u002F.env` if it doesn't exist\n- Create the `registry` database and run migrations\n\n### Running jsr\n\nStart all services, the API, and the frontend in a single terminal:\n\n```sh\ndeno task dev\n```\n\nOn Linux, if you manage PostgreSQL outside of Docker:\n\n```sh\ndeno task dev --no-docker-postgres\n```\n\nWhile running, type commands into the prompt at the bottom:\n\n- `restart \u003Cname|all>` - restart a process (or all)\n- `help` - show available commands\n- `quit` \u002F Ctrl+C - shutdown all and exit\n\nYou can also run a single service standalone:\n\n```sh\ndeno task dev start \u003Cname> [args...]\n```\n\nYou can view the registry at `http:\u002F\u002Fjsr.test`. The API can be found at\n`http:\u002F\u002Fapi.jsr.test`.\n\n### Publishing a package to the local dev environment\n\n1. Create a new directory with a `deno.json`\n2. `cd` into that directory\n3. Run `JSR_URL=http:\u002F\u002Fjsr.test deno publish`\n\n### Populating local dev environment with additional data\n\nIt may be helpful to have a large variety of packages published to your local\ndev environment to simulate a live environment. The quickest way to fill the\nregistry with data is to publish\n[deno_std](https:\u002F\u002Fgithub.com\u002Fdenoland\u002Fdeno_std) to the registry. This can be\ndone via the following steps:\n\n1. Make sure to\n   [make yourself a staff user\u002Fadmin](#making-yourself-a-staff-useradmin).\n2. Navigate to your profile page and copy the UUID from the URL.\n3. Assign the `std` scope to your user through the\n   [admin panel](http:\u002F\u002Fjsr.test\u002Fadmin\u002Fscopes\u002Fassign) by using the UUID from the\n   previous step.\n4. Clone https:\u002F\u002Fgithub.com\u002Fdenoland\u002Fdeno_std in the same parent folder as the\n   `jsr` project.\n5. Run `JSR_URL=http:\u002F\u002Fjsr.test deno publish` to publish all of the @std\n   packages to your local dev environment.\n\n### Making yourself a staff user\u002Fadmin\n\n1. Run `psql registry`\n2. Run `SELECT name, github_id FROM users;`\n3. You should see a table with your name and GitHub ID. Copy your GitHub ID.\n4. Run `UPDATE users SET is_staff = true WHERE github_id = xxxxxxx;`, replacing\n   `xxxxxxx` with your copied GitHub ID from the previous step.\n5. You should see a success message confirming one row has been updated.\n\n### Migrating the database\n\nWhen the database schema has been changed, you can migrate the local database by\nrunning this command:\n\n```sh\ndeno task db:migrate\n```\n\n### Loading bad words\n\nTo load bad words into the database:\n\n1. Download https:\u002F\u002Fcloud.google.com\u002Fsql\u002Fdocs\u002Fpostgres\u002Fsql-proxy\n2. Run in a terminal `cloud-sql-proxy -g [database connection string] -p 5433`\n3. Create a `bad_words.sql` file, with the contents as:\n\n```sql\nINSERT INTO bad_words (word) VALUES\n    ('word_1'),\n    -- more words\n    ('word_2');\n```\n\n4. In a separate terminal window run\n   `psql postgres:\u002F\u002F127.0.0.1:5433\u002Fregistry --user [your username] -f bad_words.sql`,\n   and provide the password for the provided username.\n\n### Contributing to documentation generation\n\nThe documentation generation is done via\n[`deno_doc`](https:\u002F\u002Fgithub.com\u002Fdenoland\u002Fdeno_doc).\n\nTo be able to use a local `deno_doc` clone in jsr, you need to add this to the\nroot `Cargo.toml` in this repository:\n\n```toml\n[patch.crates-io]\ndeno_doc = { path = \"..\u002Fdeno_doc\" }\n```\n\nPlease make sure that the version of `deno_doc` you have locally is the same\nversion as the one referenced in `api\u002FCargo.toml`, else the patching will not\nwork.\n\nPlease open PRs in the `deno_doc` repository when it is changes that should\naffect the overall documentation generation system, even if it is only for css\nchanges, with a few minor exceptions when the css changes are related to the\nintegration and layouting specific for jsr alone.\n\nFor more information on how the HTML documentation generation works and how to\nlocally work on it, please see the\n[HTML development section](https:\u002F\u002Fgithub.com\u002Fdenoland\u002Fdeno_doc?tab=readme-ov-file#html-generation)\nof `deno_doc`.\n\n### Per-branch databases\n\nThe `db:switch` tool lets you work on multiple branches without clobbering your\nmain development database. Each branch gets its own PostgreSQL database.\n\n```sh\ndeno task db:switch switch     # switch to branch db copied from main\ndeno task db:switch empty      # switch to an empty branch db\ndeno task db:switch main       # switch back to the main database\ndeno task db:switch current    # show which database is active\ndeno task db:switch list       # list all branch databases\ndeno task db:switch clean      # drop all branch databases\n```\n\nThe `switch` and `empty` commands write an `api\u002F.env.local` override file. Use\n`--method=export` to print an `export` command instead.\n\n### Other\n\nDuring local dev, traces are sent to Jaeger. You can view them at\nhttp:\u002F\u002Flocalhost:16686. You can find traces in API HTTP requests by inspecting\nthe `x-deno-ray` header.\n","jsr.io 是一个为现代 JavaScript 和 TypeScript 设计的开源包注册中心。其核心功能包括通过 Cloudflare R2 存储模块和包元数据，使用 Rust 编写的管理 API 以及基于 Fresh 框架构建并运行在 Google Cloud Run 上的前端界面。此外，它还支持通过 Orama 实现的搜索功能，并利用 Google Cloud Trace 进行分布式追踪。此项目适用于需要高效、低成本且易于维护的 JavaScript\u002FTypeScript 包管理解决方案的场景，特别适合那些希望替代 npm 或寻找更开放透明的包注册服务的开发者或团队。",2,"2026-06-11 03:45:01","high_star"]