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

@oix1987/yjd

v1.0.3

Published

A powerful rich text editor with real-time content change tracking for web applications using base javascript

Readme

@oix1987/yjd - Professional Rich Text Editor

A powerful, commercial-grade rich text editor with real-time content change tracking for web applications. Built with vanilla JavaScript for maximum performance and compatibility.

🚀 Features

  • Rich Text Formatting: Bold, Italic, Underline, Strikethrough, Subscript, Superscript
  • Advanced Formatting: Text alignment, line height, font family, text size, background colors
  • Content Management: Images, tables, links, lists, emojis, videos
  • Real-time Tracking: onChange callback for live content monitoring
  • Modern UI: Customizable toolbar with intuitive controls
  • TypeScript Support: Full type definitions included
  • Lightweight: Pure JavaScript implementation, no heavy dependencies
  • Cross-browser: Compatible with all modern browsers

📦 Installation

npm install @oix1987/yjd

💻 Usage

Basic Implementation

import RichEditor from "@oix1987/yjd";

const editor = new RichEditor("#editor-container", {
  content: "<p>Initial content</p>",
  height: 400,
  width: 800,
  theme: "light",
  placeholder: "Start typing...",
  onChange: (content) => {
    // Handle content changes here
    console.log("Content changed:", content);
    // Update your output container
    document.getElementById("output").innerHTML = content;
  },
});

CDN Usage

<!-- Using jsDelivr CDN -->
<script src="https://cdn.jsdelivr.net/npm/@oix1987/[email protected]/dist/rich-editor.min.js"></script>
<script>
  const editor = new RichEditor("#editor-container", {
    // configuration options
  });
</script>

Alternative CDN

<!-- Using unpkg CDN -->
<script src="https://unpkg.com/@oix1987/[email protected]/dist/rich-editor.min.js"></script>

⚙️ Configuration Options

| Option | Type | Default | Description | | ------------- | -------- | -------------- | --------------------------------------------- | | content | string | null | Initial content for the editor | | height | number | 400 | Editor height in pixels | | width | number | 800 | Editor width in pixels | | theme | string | 'light' | Editor theme (light/dark) | | placeholder | string | 'Type here...' | Placeholder text | | onChange | function | undefined | Callback function called when content changes |

onChange Callback

The onChange callback receives the current HTML content as a parameter:

onChange: (content) => {
  // content is the HTML string of the editor content
  console.log("New content:", content);

  // Example: Update an output container
  document.getElementById("output").innerHTML = content;

  // Example: Send to server
  fetch("/api/save-content", {
    method: "POST",
    body: JSON.stringify({ content }),
    headers: { "Content-Type": "application/json" },
  });
};

🎯 Events

The editor supports comprehensive event handling:

// Listen for text changes
editor.on("text-change", (content) => {
  console.log("Text changed:", content);
});

// Listen for focus events
editor.on("focus", () => {
  console.log("Editor focused");
});

// Remove event listener
editor.off("text-change", handler);

🔧 API Methods

| Method | Description | Parameters | Returns | | --------------------- | ------------------------ | ---------------------------------- | -------- | | getContent() | Get current HTML content | - | string | | setContent(content) | Set editor content | content: string | void | | focus() | Focus the editor | - | void | | on(event, handler) | Add event listener | event: string, handler: function | void | | off(event, handler) | Remove event listener | event: string, handler: function | void |

💼 Commercial License

This is a commercial product. For licensing information and pricing, please contact:

  • Author: Oix1987
  • License: ISC (Commercial)
  • Version: 1.0.1

📄 License

Copyright (c) 2024 Oix1987. All rights reserved.

This software is licensed under the ISC License. Commercial use requires a valid license.

🆘 Support

For technical support, feature requests, or licensing inquiries, please contact the author.

See index.html and main.js for a complete working example that demonstrates the onChange functionality with real-time output display.