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/stdIn 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=mainThis makes jsrepo far more flexibly than any other registry because you can host your registry anywhere.
Available providers
jsrepo
Download and add registry items from jsrepo.com
GitHub
Download and add registry items from a GitHub repository.
GitLab
Download and add registry items from a GitLab repository.
Bitbucket
Download and add registry items from a Bitbucket repository.
AzureDevops
Download and add registry items from an Azure DevOps repository.
Your Website
Download and add registry items from your own website.
Local Filesystem
Download and add registry items from your local filesystem.
You can customize the providers that jsrepo uses by adding them to your jsrepo.config file.
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:
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.