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

@editora/core

v1.0.3

Published

Framework-agnostic core editor engine for Editora Rich Text Editor

Readme

@editora/core

Framework-agnostic core editor engine for Editora Rich Text Editor.

📦 Installation

npm install @editora/core @editora/plugins @editora/themes @editora/react

🎯 Overview

The core package provides the fundamental editor engine that can be integrated with any JavaScript framework. It's built on top of modern web standards and provides a solid foundation for building rich text editors.

✨ Features

  • Framework Agnostic: Works with React, Vue, Angular, Svelte, or vanilla JavaScript
  • Type Safe: Full TypeScript support with comprehensive type definitions
  • Modular Architecture: Plugin-based system for extending functionality
  • Performance Optimized: Efficient DOM manipulation and memory management
  • XSS Protection: Built-in content sanitization and security
  • Accessibility: WCAG compliant with keyboard navigation support

🚀 Quick Start

Basic Usage

import { createEditor, EditorConfig } from '@editora/core';

import "@editora/themes/themes/default.css";
// Create editor configuration
const config: EditorConfig = {
  content: '<p>Hello World!</p>',
  placeholder: 'Start typing...',
  onChange: (html) => {
    console.log('Content changed:', html);
  }
};

// Create editor instance
const editor = createEditor(config);

// Mount to DOM element
const container = document.getElementById('editor');
editor.mount(container);

With Plugins

import { createEditor } from '@editora/core';
import { BoldPlugin, ItalicPlugin, HeadingPlugin } from '@editora/plugins';

import "@editora/themes/themes/default.css";

const editor = createEditor({
  plugins: [
    BoldPlugin(),
    ItalicPlugin(),
    HeadingPlugin()
  ],
  content: '<h1>Welcome</h1><p>Start writing...</p>'
});

editor.mount(document.getElementById('editor'));

📖 API Reference

createEditor(config: EditorConfig): Editor

Creates a new editor instance with the provided configuration.

Parameters:

  • config.content (string, optional): Initial HTML content
  • config.placeholder (string, optional): Placeholder text when empty
  • config.onChange (function, optional): Callback fired when content changes
  • config.plugins (Plugin[], optional): Array of plugins to load
  • config.readonly (boolean, optional): Make editor read-only
  • config.autofocus (boolean, optional): Auto-focus on mount

Returns: Editor instance

Editor Instance Methods

mount(element: HTMLElement): void

Mounts the editor to a DOM element.

editor.mount(document.getElementById('editor'));

unmount(): void

Unmounts the editor and cleans up resources.

editor.unmount();

getHTML(): string

Gets the current editor content as HTML.

const html = editor.getHTML();

setHTML(html: string): void

Sets the editor content from HTML.

editor.setHTML('<p>New content</p>');

getJSON(): object

Gets the current content as JSON (AST).

const json = editor.getJSON();

setJSON(json: object): void

Sets content from JSON (AST).

editor.setJSON(jsonContent);

focus(): void

Focuses the editor.

editor.focus();

blur(): void

Blurs the editor.

editor.blur();

clear(): void

Clears all content.

editor.clear();

destroy(): void

Destroys the editor instance and frees resources.

editor.destroy();

🔧 Configuration Options

interface EditorConfig {
  // Initial content
  content?: string;
  
  // Placeholder text
  placeholder?: string;
  
  // Change handler
  onChange?: (html: string, json: object) => void;
  
  // Focus handlers
  onFocus?: () => void;
  onBlur?: () => void;
  
  // Plugins
  plugins?: Plugin[];
  
  // Editor state
  readonly?: boolean;
  autofocus?: boolean;
  
  // Content validation
  sanitize?: boolean;
  maxLength?: number;
  
  // Performance
  debounceDelay?: number;
}

🔌 Plugin System

Create custom plugins by extending the base Plugin class:

import { Plugin, Editor } from '@editora/core';

import "@editora/themes/themes/default.css";
class CustomPlugin extends Plugin {
  name = 'custom';
  
  install(editor: Editor) {
    // Plugin initialization
    console.log('Plugin installed');
  }
  
  execute(command: string, ...args: any[]) {
    // Handle commands
    if (command === 'doSomething') {
      // Custom logic
    }
  }
}

📄 License

MIT © Ajay Kumar

🔗 Links