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

html2canfast

v1.0.0-rc.6

Published

Screenshots with JavaScript

Downloads

302

Readme

html2canfast

https://codesandbox.io/s/tender-river-ifjlm?file=/src/index.js

What is html2canfast?

html2canfast is an experimental version of html2canvas. As it is a fork of html2canvas, it derives all the syntax and functionality from it, but offers further features, specialized for performance improvements.

How does it work?

html2canfast adds two new (optional) options: renderName and replaceSelector. If you plan to take multiple screenshots of the same element, you can enter the 'fast mode', by passing in both these options. The renderName is an arbitrary key, which is used to, so to say, cache the created container, so it can be accessed in subsequent screenshots, which means html2canfast is only faster on 1+ screenshots. The replaceSelector is the selector for the element you wish to screenshot. html2canvas works by creating an iframe of the complete document on each screenshot, which includes having to request all the images, script, links etc. embedded on your site. This is, for some purposes, extremely inefficient. html2canfast 'caches' this iframe, so that it doesn't have to be re-created on each screenshot.

Example

You have a game, and want to take 1+ screenshots or the game screen, with the selector '#game'. You decide to use the key: 'game-screen'.

const gameScreen = document.getElementById('#game');

html2canvas(gameScreen, {
    renderName: 'game-screen',
    replaceSelector: '#game',
    removeContainer: false
}).then(function(canvas) {
    document.body.appendChild(canvas);
});

It is crucial to note, that the renderName 'game-screen', should from now on only be used to capture screenshots or the '#game' element, as html2canfast replaces this selector in the 'cached' container. Another note, of the utmost importance is that you must pass in the removeContainer option as false. Failing to do so will result in now performance improvements.

How much faster is it?

How much faster html2canfast is, depends mostly on two variables: the overall size (meaning number of elements) of the webpage, and the content size of the external resources (images etc.) embedded on that webpage. With that being said, the performance can be ~10000% or 100 times, faster than html2canvas. Checkout the comparison!

Installation

Available on npm html2canfast

Install:

$ npm i html2canfast