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

@image-marker/node

v0.1.0

Published

Pure Node.js Recipe renderer for Image Marker, powered by an optional Sharp peer

Readme

@image-marker/node

Pure Node.js Recipe v2 renderer for Image Marker. It has no React or React Native dependency. Sharp is an optional peer so applications decide the native image runtime and version.

npm install @image-marker/node@^0.1 sharp@^0.35

Render a Buffer

import { readFile, writeFile } from 'node:fs/promises';
import { renderNodeImage } from '@image-marker/node';

const background = await readFile('photo.jpg');
const logo = await readFile('logo.png');
const result = await renderNodeImage(
  {
    schemaVersion: 2,
    layers: [
      {
        id: 'title',
        type: 'text',
        text: 'Image Marker',
        position: { position: 'topLeft', edgeInset: 32 },
        style: {
          color: '#FFFFFF',
          fontSize: 48,
          maxWidth: '60%',
          lineHeight: 56,
          letterSpacing: 1,
          maxLines: 2,
          overflow: 'ellipsis',
        },
      },
      {
        id: 'logo',
        type: 'image',
        src: logo,
        position: { position: 'bottomRight', edgeInset: 28 },
        scale: 0.4,
        alpha: 0.9,
      },
    ],
    output: { saveFormat: 'webp', quality: 86, maxSize: 2048 },
  },
  { backgroundImage: { src: background } }
);

await writeFile('marked.webp', result.data);

Inputs may be a Buffer, Uint8Array, file path, or readable Stream.

File and Stream output

import {
  renderNodeImageToFile,
  renderNodeImageToStream,
} from '@image-marker/node';

await renderNodeImageToFile(recipe, input, 'dist/marked.png');
const stream = await renderNodeImageToStream(recipe, input);
stream.pipe(response);

Batch, concurrency, progress, cancellation, and retry

const abortController = new AbortController();
const results = await marker.renderMany(recipe, inputs, {
  concurrency: 4,
  retries: 2,
  retryDelayMs: 100,
  signal: abortController.signal,
  onRetry: ({ index, attempt, reason }) => {
    console.warn('retry', index, attempt, reason);
  },
  onBatchProgress: ({ settled, total }) => {
    console.log(`${settled}/${total}`);
  },
});

Results preserve input order and settle as fulfilled, rejected, or aborted. A readable Stream is single-use; use a Buffer or file path when an item may be retried.

Inspect

import { inspectNodeImage } from '@image-marker/node';

const info = await inspectNodeImage('photo.jpg');
// Display and encoded dimensions, format, EXIF orientation, alpha, channels…

Invisible locator

The Node package can embed a short authenticated locator in lossless PNG pixels:

import {
  detectNodeInvisibleLocator,
  embedNodeInvisibleLocator,
} from '@image-marker/node';

const embedded = await embedNodeInvisibleLocator({
  image: source,
  payload: 'asset-42',
  key: process.env.IMAGE_MARKER_TRACE_KEY!,
});

const detection = await detectNodeInvisibleLocator({
  image: embedded.data,
  key: process.env.IMAGE_MARKER_TRACE_KEY!,
});

lsb-hmac-v1 is intended for lossless server pipelines. JPEG conversion, resizing, or destructive image optimization can remove it. Keep production keys in a secret manager and store only an opaque locator in pixels.

Dependency injection

Sharp loads lazily. Tests or managed runtimes can inject a compatible Sharp factory and set a process-level batch ceiling:

import sharp from 'sharp';
import { createNodeImageMarker } from '@image-marker/node';

const marker = createNodeImageMarker({
  sharp,
  maxConcurrency: 8,
});

The package re-exports @image-marker/recipe, so validation, migration, templates, placeholders, conditions, and layer operations are available from the same entry.