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

creaditor-image-editor

v1.0.0

Published

A powerful web-based image editor built with Lit and Fabric.js

Readme

@creaditor/image-editor

A powerful, feature-rich web-based image editor built with Lit and Fabric.js. This component provides a complete image editing solution with cropping, text editing, shape drawing, and more.

Features

  • 🖼️ Image Upload & Gallery: Upload images or choose from a built-in gallery
  • ✂️ Crop & Resize: Advanced cropping with aspect ratio controls and resize handles
  • 📝 Text Editing: Add and edit text with rich formatting options
  • 🔷 Shape Drawing: Draw various shapes (rectangles, circles, lines)
  • 🎨 Canvas Manipulation: Resize canvas, zoom, and pan functionality
  • 🌐 Internationalization: Multi-language support
  • 📱 Responsive Design: Works on desktop and mobile devices
  • Web Components: Built with Lit for easy integration

Installation

npm install @creaditor/image-editor

Quick Start

<!DOCTYPE html>
<html>
<head>
    <title>Image Editor Demo</title>
</head>
<body>
    <cdtr-image-editor 
        width="800" 
        height="600" 
        lang="en">
    </cdtr-image-editor>

    <script type="module">
        import '@creaditor/image-editor/my-element.js';
    </script>
</body>
</html>

Usage

Basic Usage

import '@creaditor/image-editor/my-element.js';

// Get the editor element
const editor = document.querySelector('cdtr-image-editor');

// Set initial image
editor.imageUrl = 'https://example.com/image.jpg';

// Listen for save events
editor.addEventListener('save-image', (event) => {
    const imageData = event.detail;
    // Handle the saved image data
});

Properties

| Property | Type | Default | Description | |----------|------|---------|-------------| | width | Number | 800 | Canvas width in pixels | | height | Number | 600 | Canvas height in pixels | | lang | String | 'en' | Language code for internationalization | | imageUrl | String | undefined | Initial image URL to load | | galleryImages | Array | [] | Array of gallery images |

Events

| Event | Detail | Description | |-------|--------|-------------| | save-image | {dataUrl: string, blob: Blob} | Fired when image is saved | | image-uploaded | {file: File} | Fired when new image is uploaded | | canvas-resized | {width: number, height: number} | Fired when canvas is resized |

API Reference

Methods

addImage(file: File)

Adds an image to the canvas from a File object.

loadImageFromUrl(url: string)

Loads an image from a URL.

saveImage()

Saves the current canvas as an image and triggers the save-image event.

clearCanvas()

Clears the entire canvas.

Styling

The component uses CSS custom properties for theming:

cdtr-image-editor {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #ffffff;
    --border-color: #dee2e6;
    --text-color: #212529;
}

Development

Setup

# Install dependencies
npm install

# Start development server
npm run serve

# Build for production
npm run build

# Run tests
npm test

Project Structure

src/
├── components/          # UI components
│   ├── canvas.ts       # Main canvas component
│   ├── navbar.ts       # Top navigation bar
│   ├── sidebar.ts      # Sidebar with tools
│   ├── upload-button.ts # File upload component
│   └── ...
├── store/              # State management
├── utils/              # Utility functions
├── i18n/               # Internationalization
└── styles.ts           # Global styles

Building

The project uses TypeScript and Rollup for building:

# Development build
npm run build

# Production build with minification
npm run build:prod

# Watch mode for development
npm run build:watch

Testing

# Run all tests
npm test

# Run tests in development mode
npm run test:dev

# Run tests in production mode
npm run test:prod

# Watch mode for tests
npm run test:watch

Browser Support

  • Chrome 80+
  • Firefox 75+
  • Safari 13+
  • Edge 80+

Dependencies

  • Lit: Web components framework
  • Fabric.js: Canvas manipulation library
  • Cropper.js: Image cropping functionality
  • TypeScript: Type safety and development experience

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

Support

Changelog

See CHANGELOG.md for a list of changes and version history.

image-editor