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

@michaelyagi/kiri

v0.1.0-alpha.10

Published

A dependency-free TypeScript library for interactive image cropping in the browser.

Downloads

1,467

Readme

AI-authored. 100% of the code was written by Claude (Anthropic); I shaped the architecture, scope, and every decision, and did all the testing.

Kiri

A dependency-free TypeScript library for interactive image cropping in the browser.

Features

  • Drag, zoom, rotate, flip — wheel/trackpad pinch zoom, an optional built-in zoom slider (showZoomer, placeable on any of the four sides), 90° rotation, independent horizontal/vertical flip
  • Rectangle, circle, or rounded-rectangle frame — circle/rounded-rectangle are real clips on export (transparent corners on PNG/WebP), not just a visual overlay
  • Zero-CSS sizing — the stage auto-sizes itself to the frame's dimensions
  • Filters — brightness/contrast/saturation/sharpness/grayscale/sepia, applied identically to the live preview and the export
  • Automatic EXIF orientation correction on load
  • Resizable frame, four independent corner handles, with an optional lockAspectRatio to keep a fixed ratio while resizing
  • movableFrame — invert the interaction model: freeze the image and drag/resize the frame over it instead of panning/zooming the image
  • setOffset()/reset() for programmatic panning and reverting to the post-load() state
  • getCropRegion() — the crop mapped back to the original image's own pixel coordinates, for server-side cropping of the full-resolution source
  • Keyboard-accessible — the stage is focusable; arrow keys pan, +/- zoom, 0 resets
  • Export to base64, Blob, or Canvas — JPEG/PNG/WebP, custom output size
  • Upload — a built-in FormData/fetch helper, or plug in your own
  • Batch cropping — a documented recipe for stepping one shared cropper through a queue of images, no separate class needed
  • React and Vue wrappers (kiri-react, kiri-vue) — thin components, no duplicated logic, reactive to prop changes after mount
  • Runtime-validated options (a typo'd setting warns and falls back rather than silently misbehaving), a clear error if the container element is missing, and a real, CSP-safe stylesheet instead of injected styles
  • Ships as ESM for bundlers and UMD/CJS for a plain <script> tag — minified and unminified builds of both

Install

npm install @michaelyagi/kiri

npmjs.com/package/@michaelyagi/kiri

Zero-config quickstart

<link rel="stylesheet" href="node_modules/@michaelyagi/kiri/dist/kiri.min.css" />
<script src="node_modules/@michaelyagi/kiri/dist/kiri.min.js"></script>
<div id="cropper"></div>
<script>
  const cropper = new Kiri(document.getElementById("cropper"), {
    frame: { shape: "circle", width: 200, height: 200 },
  });
  await cropper.load("photo.jpg");
  const blob = await cropper.export({ type: "blob" });
</script>

No CSS sizing needed on the container — the stage auto-sizes itself to the frame's dimensions. See Getting started for npm/ESM installation too.

Documentation

michaelyagi.github.io/kiri — getting started, every method/event/setting, guides, real runnable examples, an interactive playground, and the full API reference.

Packages

| Package | Path | What it is | |---|---|---| | @michaelyagi/kiri | packages/core | The library itself — framework-agnostic | | kiri-react | packages/react | <KiriCropper> React component (unpublished) | | kiri-vue | packages/vue | <KiriCropper> Vue component (unpublished) |

Status

0.1.0-alpha.10 — see CHANGELOG.md for what's in it. Core publishes to npm automatically on version tags via GitHub Actions; kiri-react/kiri-vue aren't published yet. The public API is expected to be mostly stable but may still change before a 0.1.0 (non-alpha) release.

Development

npm install                # installs all workspace packages
npm run dev                 # core demo at http://localhost:5173
npm run build                # builds all three packages
npm test                      # runs all three packages' test suites
npm run docs:build             # rebuilds the docs/ site (library + API reference + asset sync)

See design.md for the full design document.