Providers

Host your code anywhere with jsrepo.

Providers are how jsrepo knows where to find registry items. When you provide a registry identifier to a jsrepo command the provider is responsible for resolving that to a usable URL.

For example you might run the following command:

jsrepo init github/ieedan/std

In this case the github provider will be used to resolve the path to the registry.json file which might look something like this:

https://api.github.com/repos/ieedan/std/contents/registry.json?ref=main

This makes jsrepo far more flexibly than any other registry because you can host your registry anywhere.

Available providers

You can customize the providers that jsrepo uses by adding them to your jsrepo.config file.

jsrepo.config.ts
import { defineConfig } from "jsrepo";
import { github } from "jsrepo/providers"; 

export default defineConfig({
	providers: [github()], 
});

Provider plugins

Provider plugins are a way to add support for additional providers to jsrepo.

Adding provider plugins

You can add provider plugins by running the following command:

jsrepo config provider <plugin>

This will automatically install the plugin and add it to your config file:

jsrepo.config.ts
import { defineConfig, DEFAULT_PROVIDERS } from "jsrepo"; 
import myProvider from "jsrepo-provider-myprovider"; 

export default defineConfig({
	providers: [...DEFAULT_PROVIDERS, myProvider()], 
});

You will notice the addition of the DEFAULT_PROVIDERS object in the example above. This way you can continue to use all other providers alongside your provider plugin.