npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@layera-labs/orbit-providers

v1.0.0-beta.4

Published

Pluggable template/font/background/photo provider interfaces for Orbit

Readme

@layera-labs/orbit-providers

Where the Orbit v2 editor gets its content from: templates, fonts, photos, videos, backgrounds, stock assets, storage, publishing. This package defines the interfaces and a registry that resolves them by kind, plus four small built-ins so a demo runs with no keys.

It contains no UI and no network client of consequence. It is the seam you implement so the editor shows your templates and your asset library instead of somebody else's.

This is v2, alongside @layera-labs/orbit-model, @layera-labs/orbit-render and @layera-labs/orbit-editor.

npm i @layera-labs/orbit-providers@beta

Beta. 1.0.0-beta.3 under the beta tag; the API moves without notice.

An absent provider hides its panel

This is the design decision worth knowing, and it is borrowed from Polotno. Sections in the editor UI read from the registry and hide themselves when their provider is absent. You do not configure which panels appear; you supply providers, and the panels follow.

So a registry with a font provider and nothing else produces an editor with a Fonts panel and no Templates, Photos or Backgrounds panel — not an editor with four panels, three of which are empty or throw.

import { ProviderRegistry, GoogleFontProvider, PicsumPhotoProvider } from '@layera-labs/orbit-providers';

const registry = new ProviderRegistry({
  fonts: new GoogleFontProvider(),
  photos: new PicsumPhotoProvider(),
  // no `templates`, so the editor renders no Templates section
});

registry.has('backgrounds');                  // false
registry.set('backgrounds', myBackgrounds);   // now it does
registry.all();                               // the ProviderMap back out

Note the keys are plural (photos, videos, templates, fonts, backgrounds, assets) while each provider's own kind is singular ('photo', 'template'). The map is a slot list; the kind is a discriminant on the object.

@layera-labs/orbit-editor takes the ProviderMap itself, not the registry — it builds the registry internally:

<OrbitEditor providers={{ fonts: new GoogleFontProvider() }} />

Construct a ProviderRegistry when you are resolving providers in your own code.

Writing one

Every provider is a plain object with an id and the methods for its kind. Nothing is subclassed and nothing is registered globally.

import type { TemplateProvider, TemplateSummary } from '@layera-labs/orbit-providers';

export const houseTemplates: TemplateProvider = {
  id: 'house',
  kind: 'template',
  async list(opts) {
    const res = await fetch(`/api/templates?page=${opts?.page ?? 1}`);
    return (await res.json()) as TemplateSummary[];
  },
  async getDocument(id) {
    return (await fetch(`/api/templates/${id}`)).json();
  },
};

A TemplateProvider returns lightweight TemplateSummary records for the grid and a full Document (from @layera-labs/orbit-model) on get, so a panel of two hundred templates does not download two hundred documents.

The kinds

photo, video, asset, template, font, background resolve through ProviderRegistry. StorageProvider and PublishTarget are declared here too but are not part of the registry map — they are separate interfaces a host implements for persistence and for publishing a finished design.

The built-ins

PicsumPhotoProvider (Lorem Picsum, no key), GoogleFontProvider, PresetBackgroundProvider and DemoTemplateProvider. They exist so the examples run out of the box. They are demo-grade, and honestly so: PicsumPhotoProvider does not search at all, it feeds the query into picsum.photos as a seed, so the results are stable for a given term and have nothing to do with it. Swap in an Unsplash or Pexels provider against the same PhotoProvider interface before shipping.

Links

MIT.