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

vite-plugin-kapar

v0.1.1

Published

Screen recording and screenshot taking via the HTML-in-Canvas API (Vite Plugin)

Readme

vite-plugin-kapar

vite-plugin-kapar is a Vite dev-plugin for taking screenshots and recording .webm videos of your web application directly from the DOM.

It injects a sleek floating widget into your application during development, leveraging the experimental HTML-in-Canvas API to achieve zero-permission screen captures. It completely bypasses clunky getDisplayMedia screen-sharing prompts.

As a bonus, it includes a Grease Pencil (Pen) feature, allowing you to annotate your screen in real-time while recording demos or finding bugs.

Key Features

  • Vite Dev Plugin: Injects seamlessly during development mode (apply: 'serve'), zero impact on production builds.
  • Framework Agnostic: Bundles its UI runtime internally—works out of the box with Vue, Svelte, React, Solid, or Vanilla JS projects.
  • Zero Permission Prompts: No "Share your screen" popups.
  • Pixel-Perfect Scaling: Define exact capture dimensions regardless of your actual viewport.
  • Fully Interactive: The captured DOM elements remain interactive (clicks, hovers, inputs).
  • Built-in Pen Tool: Draw over your application in real-time.

Prerequisites (Crucial)

Because the HTML-in-Canvas API is currently experimental, this package requires specific browser settings to work:

  1. Use Chrome Canary (or Chromium 147+).
  2. Navigate to chrome://flags/#canvas-draw-element.
  3. Enable the HTML elements in canvas flag and restart your browser.

Installation

Install the package via NPM as a development dependency:

npm install vite-plugin-kapar -D

Usage

Add the plugin to your vite.config.ts.

import { defineConfig } from 'vite';
import { kaparPlugin } from 'vite-plugin-kapar';

export default defineConfig({
  plugins: [
    kaparPlugin({
      targetSelector: '#app-wrapper' // Optional: target your app's main wrapper (defaults to #app, #root, or body)
    })
  ]
});

Once configured, start your Vite dev server (npm run dev). A floating widget will automatically appear in the bottom right corner of your app, giving you instant access to screenshot, recording, and pen tools.


Local Testing & Development

If you want to contribute to kapar or test it locally within another project:

1. Clone and Build:

git clone https://github.com/zerdalu/kapar.git
cd kapar
npm install
npm run build
npm link

2. Link to a local test project:

# Inside your test project folder (e.g., a blank Vite app):
npm link vite-plugin-kapar

Known Issues

  • Viewport-Fixed Elements (position: fixed): Elements styled with position: fixed relative to the browser viewport may not appear inside the capture canvas. Workaround: Wrap fixed elements or assign them position: absolute relative to your targeted application container.
  • Cross-Origin Content (CORS): Elements containing cross-origin resources (such as external images, web fonts, or nested <iframe> contents) may fail to render or taint the canvas due to browser security boundaries.
  • Experimental API Reliance: Since this uses the experimental drawElementImage API, performance and rendering stability are tied to the browser's experimental canvas implementation.

Roadmap

  • Video Quality and Bitrate Controls: Expose advanced configuration options for video capturing (e.g., custom bitrates, VP9/AV1 encoding formats) to maximize output recording quality.
  • Enhanced Grease Pencil Tools: Expand the annotation tool with vector shapes (arrows, rectangles, circles), an eraser brush, and adjustable brush opacity.
  • Audio Capture Integration: Add options to capture microphone audio track inputs alongside the video stream during session recording.
  • Additional Image Export Formats: Support exporting screenshots as .webp or .jpeg alongside standard .png.
  • Preflight Style Refinements: Optimize the inline CSS preflight reset to ensure broader layout rendering compatibility inside the Shadow DOM widget.

License

MIT © zerdalu