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

arcox

v0.0.2

Published

An extensible markdown editor

Readme

Arcox is an extensible markdown editor with plugin support.

It uses API-driven design and separates the editor from the renderer.You can use it anywhere and customize styles easily.

Installation

$ npm install arcox --save

Getting started

html

<textarea id="editor"></textarea>
<div id="renderer"></div>

js

import { Editor, Renderer } from "arcox";
import "arcox/css/arcox.css";
import "arcox/css/highlight.css";

let editor = new Editor("#editor");
let renderer = new Renderer("#renderer");

editor.bind(renderer);

more configuration

let editor = new Editor({
    el: "#editor", // the textarea element id
    plugins:{
        undo: true, // disable the undo plugin by setting to false
        tab: true // disable the tab plugin by setting to false
    },
    formats:{
        heading1: {
            name: "heading1",
            prefix: "# "
        },
        ...
    }
})
let renderer = new Renderer({
    el: "#renderer", // the element id the renderer mounted
    lang: "js" // default language for highlight.js
})

Editor

props

|prop|type|description| |-|-|-| |el|Object|the textarea element| |config|Object|editor's config| |renderer|Object|binding renderer instance|

methods

let editor = new Editor("#editor");

/**
 * focus the editor
 */
editor.focus();

/**
 * set the value of editor.
 * 
 * value:String
 */
editor.setContent(value);

/**
 * get the value of editor.
 */
editor.getContent();

/**
 * set selection area.
 *
 * startIndex: nonnegative integer
 * endIndex:   nonnegative integer
 */
editor.setSelection(startIndex,endIndex);


/**
 * get selection area
 */
editor.getSelection();

/**
 * insert formatting string
 * 
 * key: "heading1" | "bold" | "italic" | "image" ...
 */
editor.format(key);

/**
 * use your custom plugin
 *
 * plugin: Function
 */
editor.use(plugin);

/**
 * emit an async event.
 *
 * event:String
 */
editor.emit(event);

/**
 * emit an sync event.
 *
 * event:String
 */
editor.emitSync(event);

/**
 * add an event listener.
 *
 * event: String
 * callback: Function
 */
editor.on(event, callback);

/**
 * bind a renderer.
 *
 * renderer: Renderer
 */
editor.bind(renderer);

/**
 * unbind with renderer.
 */
editor.unbind();

events

editor.on("change",function(val){
    console.log(val);
});

editor.on("keydown",function(e){
    // ctrl+z example
    if (e.code === 90 && (e.ctrl || e.meta) && !e.alt && !e.shift) {
        e.preventDefault();
        e.stopPropagation();
    }
});

plugin example

let editor = new Editor("#editor");

let plugin = function(editor){
    editor.setContent("custom plugin"); // do anything you want
}
editor.use(plugin);

prefab plugins

if you want to disable any of them,configure it to false.

|name|description| |-|-| |undo|undo:ctrl+z; redo:ctrl+y| |tab|press tab to insert one '\t'|

formats

|key|name|prefix|subfix| |-|-|-|-| |heading1|heading1|# || |heading2|heading2|## || |heading3|heading3|### || |heading4|heading4|#### || |heading5|heading5|##### || |heading6|heading6|###### || |bold|bold|**|*| |italic|italic||*| |blockquote|blockquote|> || |strike|strike|~~|~~| |link|link|[|](url)| |image|image|![|](url)| |table|col||||col|col|\n|-|-|-|\n|col|col|col|| |codeblock|js|```|\n```| |inlinecode|code|`|`|

custom formats

// custom your own formats.
// prefix and subfix cannot be lacked at the same time
let editor = new Editor({
    el: "#editor",
    formats:{
        custom: {
            name: "format name",
            prefix: "prefix",
            subfix: "subfix"
        },
    }
});

Renderer

props

|prop|type|description| |-|-|-| |el|Object|dom element| |config|Object|renderer's config| |editor|Object|binding editor instance| |md|Object|instance of markdown-it| |html|String|render result|

methods

let renderer = new Renderer("#renderer");

/**
 * source: markdown text
 */
renderer.render(source);

/**
 * return current render result
 */
let html = renderer.getHtml();

/**
 * same as Editor
 */
renderer.emit(event);
renderer.emitSync(event);
renderer.on(event, callback);
renderer.bind(editor);
renderer.unbind();