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

@jmgbb/sdk

v1.0.0

Published

Official JavaScript/TypeScript SDK for jmgBB image hosting API

Downloads

17

Readme

jmgBB SDK

Official JavaScript/TypeScript SDK for jmgBB image hosting API.

Install

npm install jmgbb-sdk
# or
yarn add jmgbb-sdk
# or
pnpm add jmgbb-sdk

Quick Start

import { JmgbbClient } from 'jmgbb-sdk'

// Anonymous upload (no account needed)
const client = new JmgbbClient()
const result = await client.upload(fileInput.files[0])
console.log(result.url)  // Direct image URL
console.log(result.urlViewer)  // jmgBB viewer page

Authentication

JWT Token (logged-in users)

const client = new JmgbbClient({
  token: 'your-jwt-token',
})
// All requests will include Authorization: Bearer <token>

API Key (coming soon)

const client = new JmgbbClient({
  apiKeyId: 'ak_xxxx',
  apiKeySecret: 'your-secret',
})

Upload

Single file

const result = await client.upload(file, {
  title: 'My Photo',
  description: 'A beautiful sunset',
  expiration: 'P1W',  // 1 week. Options: PT5M, PT15M, PT30M, PT1H, PT3H, PT6H, PT12H, P1D, P2D, P3D, P1W, P1M, P3M, P6M, P1Y
  albumId: 'optional-album-id',
})

Batch upload

const results = await client.uploadBatch(files, {
  expiration: 'P1D',
  onProgress: (completed, total) => {
    console.log(`Uploaded ${completed}/${total}`)
  },
})

Images

List your images

const list = await client.listImages({ page: 1, limit: 20 })
console.log(list.items)
console.log(list.total)   // total image count

Get single image

const img = await client.getImage('abc123xyz')
console.log(img.url)

Update image

await client.updateImage('abc123xyz', {
  title: 'New Title',
  description: 'New description',
  albumId: 'new-album-id-or-null',
})

Delete image

// With JWT auth (owner)
await client.deleteImage('abc123xyz')

// Without auth, using delete token from upload result
await client.deleteImage('abc123xyz', deleteToken)

Albums

const albums = await client.listAlbums()

Old Photo Restoration

// From uploaded file
const result = await client.enhance(fileInput.files[0], "full")
// { id: 'xyz', url: '...', mode: 'full', creditsUsed: 1 }

const result = await client.enhance(fileInput.files[0], "complete")
// Full restoration + colorization + 4x upscale

// From external URL (no upload needed)
const result = await client.enhance("https://example.com/old-photo.jpg", "complete")

Modes:

  • "light" — denoise + deblur + 2x upscale
  • "full" — light + scratch removal + face enhancement + 2x upscale
  • "complete" — full + colorization + 4x upscale

Background Removal

// Remove background from an uploaded file
const blob = await client.removeBackground(fileInput.files[0])
const url = URL.createObjectURL(blob)
document.querySelector("img").src = url

// Remove background from external URL
const blob = await client.removeBackground("https://example.com/photo.jpg")

Share

const share = await client.createShare(['img1-id', 'img2-id'])
console.log(share.url)  // Public gallery URL

Build from source

npm install
npm run build

Outputs dist/ with CJS and ESM bundles + TypeScript declarations.

Local Installation (.tgz)

If you want to install from a local .tgz package (e.g. for offline or private distribution):

# Build and package
bash package-local.sh

# Install from local .tgz
npm install ./jmgbb-sdk-<version>.tgz

Or distribute the .tgz file directly — recipients can install it without npm registry access.

License

MIT