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

@cehlers88/ceutils

v1.2.78

Published

JavaScript utilities for DOM manipulation such as creating, appending, removing, replacing elements and more.

Readme

CEUTILS

A comprehensive TypeScript/JavaScript utility library providing DOM manipulation, canvas drawing, data handling, vector mathematics, and component management tools for modern web development.

npm version License: ISC

Features

  • DOM Library: Simplified DOM manipulation with extended HTMLElement methods
  • Canvas Library: Easy-to-use 2D canvas drawing utilities
  • Vector2D: Comprehensive 2D vector mathematics for game development
  • Data Handling: Event-driven data management with caching
  • Dialog System: Abstract dialog management for modals and popups
  • Object Store: Global object storage and singleton management
  • Component System: React-like component management
  • TypeScript Support: Full TypeScript definitions included

Installation

npm install @cehlers88/ceutils

Quick Start

// Import specific utilities
import { domLib, canvasLib, Vector2D, Datahandler } from "@cehlers88/ceutils";

// Or import the entire library
import ceutils from "@cehlers88/ceutils";

Core Libraries

DOM Library

Simplifies DOM manipulation with extended methods and utility functions.

import { domLib } from "@cehlers88/ceutils";

// Create elements with properties and events
const button = domLib.createElement("button", {
    innerText: "Click me!",
    class: "btn-primary",
    onClick: () => console.log("Button clicked!")
});

// Extended HTMLElement methods
document.body.appendChilds([button]);
const parent = button.getParentWithClass("container");

→ See complete DOM Library documentation

Canvas Library

Simplified 2D canvas drawing with a clean API.

import { canvasLib } from "@cehlers88/ceutils";

const canvas = document.getElementById("myCanvas");
const drawEngine = canvasLib.getDrawEngine(canvas);

// Draw a rectangle with fill and stroke
drawEngine.rectangle({
    x: 10, y: 10,
    width: 100, height: 100
}, "black", "yellow");

→ See complete Canvas Library documentation

Vector2D

Comprehensive 2D vector mathematics for game development and animations.

import { Vector2D } from "@cehlers88/ceutils";

const position = new Vector2D(100, 200);
const target = new Vector2D(300, 400);

// Calculate distance and movement
const distance = position.doWithVector(target).calculateDistance();
const moveVector = position.doWithVector(target).getNomalizedMoveVector({ x: 5, y: 5 });

// Apply movement
position.addVector(new Vector2D(moveVector.x, moveVector.y));

Advanced Components

Data Handler

Event-driven data management with automatic change detection.

import { Datahandler } from "@cehlers88/ceutils";

const dataHandler = new Datahandler();

// Set and get data
dataHandler.setData("user", { name: "John", age: 30 });
console.log(dataHandler.getData("user")); // { name: "John", age: 30 }

// Listen for changes
dataHandler.addListener("dataChanged", (data) => {
    console.log("Data changed:", data);
});

Cached Data Provider

Reduces API calls by caching responses.

import { CachedDataProvider } from "@cehlers88/ceutils";

const provider = new CachedDataProvider();

// Fetch data (cached automatically)
provider.fetch({
    url: "https://api.example.com/users",
    evalJson: true
}).then(data => {
    console.log("User data:", data);
});

// Clear cache when needed
provider.clearCache();

Dialog System

Abstract dialog management for modals and popups.

import { Dialog, DialogProvider } from "@cehlers88/ceutils";

class ConfirmDialog extends Dialog {
    constructor(message) {
        super();
        this.name = "ConfirmDialog";
        this.props = { message };
    }
    
    getAcceptations() {
        return ["yes", "no"];
    }
}

const dialogProvider = new DialogProvider();
dialogProvider.showDialog(new ConfirmDialog("Are you sure?"))
    .then(result => {
        console.log("User chose:", result.acceptance);
    });

Object Store Provider

Global object storage and singleton management.

import { ObjectStoreProvider } from "@cehlers88/ceutils";

const store = new ObjectStoreProvider();

// Store objects globally
store.addObject(new MyService(), "mainService", { group: "services" });

// Retrieve objects
const service = store.getObject("mainService").instance;
const allServices = store.getObjectsByGroup("services");

→ See complete Components documentation

Event Handler

Provides event-driven architecture with listener management.

import { Eventhandler } from "@cehlers88/ceutils";

class MyComponent extends Eventhandler {
    constructor() {
        super();
        this.value = 0;
    }
    
    increment() {
        this.value++;
        this.dispatch("valueChanged", this.value);
    }
}

const component = new MyComponent();
component.addListener("valueChanged", (value) => {
    console.log("New value:", value);
});

API Reference

Available Exports

// Main exports
import {
    // Core libraries
    domLib,
    canvasLib,
    
    // Classes
    Vector2D,
    Datahandler,
    Eventhandler,
    Dialog,
    CachedDataProvider,
    DialogProvider,
    ObjectStoreProvider,
    
    // Utilities
    createStore
} from "@cehlers88/ceutils";

// Default export (contains all above)
import ceutils from "@cehlers88/ceutils";

TypeScript Support

Full TypeScript definitions are included. Key interfaces:

  • IVector2D - Vector interface
  • ICreateElementProperties - DOM element properties
  • IDataEntry - Data handler entry
  • IDialog - Dialog interface
  • IStoredObject - Object store entry

Browser Compatibility

  • Modern Browsers: Chrome 60+, Firefox 60+, Safari 12+, Edge 79+
  • Node.js: 12+ (for server-side usage)
  • Dependencies: React 17+ (for React components)

Development

# Install dependencies
npm install

# Build the library
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

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 ISC License - see the LICENSE file for details.

Author

Christoph Ehlers - [email protected]

Changelog

Version 1.2.77

  • Enhanced TypeScript support
  • Improved documentation
  • Added Vector2D class
  • Extended canvas utilities
  • Bug fixes and optimizations

Support