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

@thumbrella/client

v1.4.2

Published

TypeScript client for the Thumbrella thumbnail API - typed results, streaming batches, pluggable caching

Readme

@thumbrella/client

TypeScript/JavaScript client for Thumbrella, a fast thumbnail server for images, video, documents, and more.

npm version License

The client git repository also has packages for other languages and environments. See Python, Rust, and the full client documentation.

For browser galleries and file browsers, start with the <tbr-thumb> web component. Use the Client API when your application needs to control requests, caching, batching, or streaming directly.

Features

  • Zero runtime dependencies, only needs fetch
  • Runs in Node 18+, Deno, Bun, and modern browsers
  • <tbr-thumb> web component for browser environments
  • Single call efficiently processes multiple thumbnails in parallel
  • Stream async results as the server renders thumbnails
  • Client caching integrates with server and HTTP
  • Placeholders for failures, even if disconnected or misconfigured
  • Load easily into sharp and other image libraries
  • Typed results with simple media metadata
  • Thumbrella server supports 100+ formats

Quickstart - Browser

Install the package if your application uses a bundler:

npm install @thumbrella/client
<script type="module">
  import { tbrSetup } from "@thumbrella/client/browser";
  tbrSetup("http://localhost:3114");
</script>

<tbr-thumb
  src="https://demo.thumbrella.dev/media/space-colony.jpg"
  alt="Space colony">
</tbr-thumb>

For a static web page, import directly from the CDN and avoid the npm operations with import { tbrSetup } from "https://js.thumbrella.dev/1.4/tbr.js";

The tbrSetup call registers <tbr-thumb> and configures its loading states, placeholders, caching, and lazy loading.

Quickstart - Node and server

import { Client } from "@thumbrella/client";

// Defaults to $TBR_CONNECT of no `Client` argument provided
const tbr = await new Client("http://localhost:3114")

// Fetch a single thumbnail
const result = await tbr.thumb("https://demo.thumbrella.dev/media/pocket-game.webp");
console.log(result.status, result.media?.thumbnail.length ?? 0, "bytes");

// Stream results of thumbnail batch
const mediaUrls = [
  "https://demo.thumbrella.dev/media/padres-stereo.exr",
  "https://demo.thumbrella.dev/media/golden-gate.exr",
];
for await (const result of tbr.stream(mediaUrls)) {
  console.log(result.url, result.status);
}

Module Structure

| Import | Contents | |--------------------------------------|----------------------------------------------| | @thumbrella/client | Client, Result, Media, EncodedJpeg, types | | @thumbrella/client/browser | browser helpers, <tbr-thumb> element, tbrSetup() |

Node users only import from the root. Browser users import from browser, which includes tbrSetup, the <tbr-thumb> element, and the client functionality used by the component.

Where to Run It

The client uses only fetch and standard APIs, so it works anywhere modern JS runs. The same import works in:

  • Node 18+ - server-side scripts, workers, CI pipelines
  • Browsers - directly in a <script type="module"> or bundled with your SPA
  • Edge runtimes - Cloudflare Workers, Deno Deploy, Bun

Servers

This client works with self-hosted Thumbrella servers and the online Thumbrella Cloud service. Both are configured using the $TBR_CONNECT environment variable. Alternatively, pass a connect string to the Client constructor:

new Client("http://localhost:3114");             // local server
new Client("tbr_e_3QnzBcWx7KpRmYT2000example");  // cloud token
new Client("https://demo.thumbrella.dev");       // free demo server

Thumbrella provides a demo gallery and server that can be used for free with no account or signup. Use it for experimenting; configure your own server or Cloud token for production applications.

License

Apache-2.0. See LICENSE.