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

@arkpad/core

v1.6.15

Published

Core engine for the Arkpad rich text editor.

Readme

@arkpad/core

The high-performance, modular engine for the Arkpad rich text editor. Built on ProseMirror, designed for developers who need absolute control.

📦 Installation

npm install @arkpad/core

🚀 Usage

import { ArkpadEditor, Essentials } from "@arkpad/core";

const element = document.querySelector("#editor");

if (element) {
  const editor = new ArkpadEditor({
    element,
    extensions: [Essentials],
    content: "<p>Hello World</p>",
    onUpdate: ({ editor }) => {
      console.log(editor.getHTML());
    },
  });
}

🛠 API Reference

Configuration Options

| Option | Type | Description | | :----------- | :--------------- | :-------------------------------------------------- | | element | HTMLElement | The DOM element to attach the editor to. | | extensions | Extension[] | Array of Arkpad extensions. | | content | string \| JSON | Initial content (HTML or JSON). | | editable | boolean | Whether the editor is editable. Defaults to true. | | autofocus | boolean | Focus the editor on creation. |

Instance Methods

Content

  • getHTML(): string - Returns document as HTML.
  • getJSON(): object - Returns document as ProseMirror JSON.
  • getText(): string - Returns document as plain text.
  • getMarkdown(): string - Returns document as Markdown. (Requires markdown-compatible extensions).
  • setContent(content: string | JSON) - Replaces editor content.
  • clearContent() - Wipes the document.

State & Commands

  • commands - Proxy object to run commands: editor.commands.toggleBold().
  • chain() - Start a command chain.
  • isActive(name: string, attrs?: object): boolean - Check if a mark/node is active.
  • getAttributes(name: string): object - Get attributes of the active mark/node.

Interaction

  • focus(pos?: 'start' | 'end' | number) - Focus the editor.
  • blur() - Remove focus.
  • setEditable(editable: boolean) - Toggle read-only mode.
  • destroy() - Cleanup the editor instance.

🧩 Extensions

Arkpad is entirely modular. You can use the Essentials bundle or pick individual extensions.

import { Bold, Italic, Heading, BulletList, Highlighter } from "@arkpad/core/extensions";

const editor = new ArkpadEditor({
  extensions: [Bold, Italic, Heading.configure({ levels: [1, 2] })],
});

🌟 Pro Features

Arkpad Core includes advanced features for building enterprise-grade editor experiences.

1. Typed Commands (Module Augmentation)

Get full IDE autocompletion for your custom commands by augmenting the ArkpadCommands interface.

// In your extension file
declare module "@arkpad/core" {
  interface ArkpadCommands {
    myCustomCommand: (arg: string) => void;
  }
}

// Usage
editor.commands.myCustomCommand("hello"); // Fully typed!

2. Declarative Interceptors (Performance)

High-performance transaction middleware that only runs when needed.

const MyExtension = Extension.create({
  addInterceptors() {
    return [
      {
        on: "docChanged", // Only runs if document content changes
        handler: ({ transaction }) => {
          console.log("Document changed!");
          return transaction;
        },
      },
    ];
  },
});

3. Priority & Schema Extensions

Control the loading order of extensions and modify existing node/mark schemas safely.

const HighPriorityExt = Extension.create({
  priority: 200, // Default is 100. Higher runs first.

  extendNodeSchema(nodeName, spec) {
    if (nodeName === "paragraph") {
      // Add custom attributes to all paragraphs
      return {
        ...spec,
        attrs: { ...spec.attrs, myAttr: { default: null } },
      };
    }
    return spec;
  },
});

4. Lifecycle Hooks

  • onInit(): Called when the editor is fully initialized.
  • onUpdate(): Called on every content change.
  • onDestroy(): Called during editor cleanup.

🚀 Versioning & Release Flow

Arkpad uses an automated, conventional-commit-driven release workflow:

  • Automatic Version Bumps: Any code changes in @arkpad/core trigger package version updates and generate changesets automatically on merge to main.
  • Beautiful Emojified Changelogs: Changes are grouped into clean categories like ✨ Features, 🐛 Bug Fixes, ⚡ Performance Improvements, 📝 Documentation, ♻️ Refactoring, 🎨 Styles & UI, and 📦 Others.
  • GitHub Releases: Releases are automatically published on GitHub with the release description matching the version changelog exactly.

Built by ArkCabin