Publishing a package
A package on the registry is a GitHub repository. Releases of the repository are the versions of the package.
Sign in
Sign in with GitHub. The registry only asks for your public profile.
Describe your dependencies
Add a
spice.jsonfile to the root of your repository. It is optional, but needed for the dependency tree:{ "name": "my-package", "dependencies": { "json-parser": "^1.2.0", "http-client": ">=2.0.0, <3.0.0" }, "devDependencies": { "test-kit": "*" } }Tag a release
Create a GitHub release whose tag is a semantic version, for example
v1.0.0. The release notes become the changelog. Tags that are not semantic versions are ignored.Create the package
Open the dashboard, pick your repository and choose a name and a few tags. You need push access to the repository.
Keep it in sync
The registry re-reads README, releases and dependencies regularly. After a release you can also hit Sync now on the package management page.
Version constraints
| Constraint | Matches |
|---|---|
1.2.3 | exactly 1.2.3 |
^1.2.3 | 1.2.3 up to, but excluding 2.0.0 |
~1.2.3 | 1.2.3 up to, but excluding 1.3.0 |
1.2.x | any 1.2 release |
>=1.0.0, <2.0.0 | a range |
* | any version |
Using the registry API
Everything on this site is available as JSON, for tools that want to resolve and fetch packages:
GET /api/v1/packages?q=json&tag=parser&sort=downloadsGET /api/v1/packages/{name}GET /api/v1/packages/{name}/versions/{version}(uselatestfor the newest release)GET /api/v1/packages/{name}/versions/{version}/downloadcounts the download and redirects to the archive