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 🙏

© 2025 – Pkg Stats / Ryan Hefner

chrome-ext-screenshot

v0.1.0

Published

Reusable browser-based screenshot generator for Chrome extension promo images.

Readme

Chrome Extension Screenshot Generator

Reusable HTML + JavaScript toolkit for generating Chrome extension marketing screenshots. Designed to provide:

  • Customizable HTML/CSS templates
  • One-click downloads for common resolutions (e.g. 1280×800, 640×400)
  • Automatic embedding and Data URL copy helpers
  • html2canvas loading and convenience helpers

Getting Started

cd chrome-ext-screenshot
npm install
npm run preview

Open the served templates/default.html to experiment. Update text, replace images, and trigger downloads via the buttons.

Structure

  • lib/generator.js: Core initialization and capture logic (window.ScreenshotGenerator)
  • templates/default.html: Reference template wired up with the library
  • styles/default.css: Styling for the template
  • examples/: Placeholder assets and notes

Usage

  1. Copy lib/generator.js into your project or load it via script tag.
  2. Annotate your markup:
    • Wrap the screenshot content in an element with data-screenshot.
    • Mark the element you want rendered as data-screenshot-target.
    • Add buttons with data-screenshot-download="WIDTHxHEIGHT" or data-screenshot-width/height.
    • Optional data-screenshot-output nodes receive the generated Data URL or preview.
  3. Initialize with ScreenshotGenerator.init().
<div class="promo" data-screenshot>
  <div data-screenshot-target> ... </div>
  <button data-screenshot-download="1280x800">Download</button>
</div>
<script src="./lib/generator.js"></script>
<script>
  ScreenshotGenerator.init();
</script>

Configuration

  • data-screenshot-width, data-screenshot-height: default capture size
  • data-screenshot-filename: base filename without extension
  • data-screenshot-background: override background color (transparent by default resolves automatically)
  • data-screenshot-auto="load": auto-generate on load (also supports true/embed)
  • data-screenshot-transparent="true": preserve transparency
  • data-screenshot-html2canvas: custom html2canvas URL

API

ScreenshotGenerator.init({ selector, scope, html2canvasUrl, backgroundColor, transparent });
ScreenshotGenerator.captureElement(element, options);
ScreenshotGenerator.loadHtml2Canvas(url);

captureElement returns a promise resolving to a Data URL. Pass { width, height, format, quality, backgroundColor, transparent } as needed.

License

MIT