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

yet-another-html-img-inliner

v1.1.2

Published

Inline local <img src> and srcset references in HTML into data: URLs (no remote fetches).

Readme

Yet Another HTML Img Inliner

Inline every <img src> (and srcset entries) in an HTML file into base-64 data: URLs – works for both local files and remote images – zero dependencies.

npx -y yet-another-html-img-inliner input.html -o output.inlined.html

What’s new in v2.0?

  • Remote support – downloads http(s): and protocol-relative (//…) images and inlines them.
  • Skips existing data: URLs.
  • Respects the same --maxMB size guard for remote and local images.
  • Caches repeated remote URLs to avoid multiple downloads.
  • All the previous local-handling goodness remains.

Why another inliner?

  • Local + remote support – embed assets from your filesystem and from the web.
  • Handles srcset as well as src.
  • Understands URL-encoded paths (e.g. %20 for spaces) & strips ?query#hash.
  • Case-insensitive fallback for local files (useful on Windows / mixed-case exports).
  • Size guard (--maxMB, default 10 MB per image) applies to both local and remote sources.
  • Single ~500-line script, no runtime deps—perfect for one-off builds or CI.

Install / Run

| use-case | command | | ------------------------- | -------------------------------------------------------------------------------------------------- | | one-off (recommended) | npx -y yet-another-html-img-inliner input.html -o output.html | | global | npm i -g yet-another-html-img-inlineryet-another-html-img-inliner input.html -o output.html | | project dep | npm i --save-dev yet-another-html-img-inliner → add it to your build scripts |


CLI

yet-another-html-img-inliner <input.html> [-o output.html] [--root DIR] [--maxMB 10]

Options:
  -o           Write result to file (omit to pipe to stdout)
  --root DIR   Resolve relative image paths from DIR instead of input file’s folder
  --maxMB N    Skip images larger than N megabytes (default: 10)
  -h, --help   Show this help

Examples

Inline and overwrite (guarded):

yet-another-html-img-inliner src/index.html -o dist/index.html

Pipe to stdout:

yet-another-html-img-inliner email.html > email.embedded.html

Images live in a sibling folder:

yet-another-html-img-inliner build/page.html --root build/assets -o build/page.inline.html

Remote images too:

yet-another-html-img-inliner newsletter.html -o newsletter.inline.html

Caveats

  • Adds ~33 % size overhead (base64). Heavy pages can balloon quickly.

  • Only PNG, JPEG, GIF, SVG, WebP, BMP, ICO & AVIF are recognised. Others fall back to application/octet-stream.

  • Skips data: URLs (already inline).

  • For remote images:

    • Follows up to 5 redirects.
    • Aborts downloads exceeding --maxMB limit.
    • Requires network access at runtime.
  • Refuses to overwrite the input file; choose a different -o.



Do you want me to also add an **“Advanced”** section to the README describing the redirect, timeout, and caching behavior of remote inlining? That could make the new behavior crystal-clear.