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

mark-it-core

v1.0.2

Published

Core markdown engine parser and renderer

Readme

Mark It Core

Core markdown editor and renderer for Mark It.

mark-it-core provides a browser-side Markdown editing surface, a read-only renderer, TypeScript types, and the stylesheet needed to render Mark It documents.

Features

  • Editable Markdown document surface with block-based rendering
  • Read-only Markdown renderer
  • Common Markdown blocks including headings, lists, blockquotes, code blocks, tables, task lists, images, math, and footnotes
  • Inline formatting such as bold, italic, strikethrough, highlight, links, and inline code
  • Export helpers for Markdown source and semantic HTML
  • ESM, CommonJS, and TypeScript declaration outputs

Install

npm install mark-it-core katex prismjs

katex and prismjs are peer dependencies used for math and code rendering.

Usage

import { Editor, Renderer } from 'mark-it-core';
import 'mark-it-core/style.css';

const container = document.getElementById('app') as HTMLDivElement;

const editor = new Editor(container, 'Untitled', '# Hello Mark It');

editor.onContentChange((markdown) => {
  console.log(markdown);
});

console.log(editor.getMarkdownSource());
console.log(editor.exportHTML());

editor.destroy();

Render a read-only document:

import { Renderer } from 'mark-it-core';
import 'mark-it-core/style.css';

const container = document.getElementById('preview') as HTMLDivElement;
const renderer = new Renderer(container, 'Preview', '# Hello Mark It');

renderer.destroy();

API

new Editor(container, documentTitle?, initialContent?, metadata?)

Creates an editable Markdown document.

  • container: target HTMLDivElement
  • documentTitle: optional title, defaults to 未命名
  • initialContent: optional Markdown source
  • metadata: optional document metadata

Common instance methods:

  • getMarkdownSource(): returns the current Markdown source
  • exportHTML(): returns semantic HTML for the current document
  • findAll(query, caseSensitive?): finds matching text in the document
  • replaceAll(query, replacement, caseSensitive?): replaces matching text
  • onContentChange(callback): subscribes to Markdown changes
  • destroy(): cleans up DOM and event listeners

Formatting helpers:

  • toggleBold()
  • toggleItalic()
  • toggleStrikethrough()
  • toggleCode()
  • toggleHighlight()
  • insertLink()

new Renderer(container, documentTitle?, initialContent?)

Creates a read-only Markdown renderer.

  • container: target HTMLDivElement
  • documentTitle: optional title, defaults to 未命名
  • initialContent: optional Markdown source

Use destroy() when the renderer is no longer needed.

Development

This package is part of the Mark It monorepo:

pnpm install
pnpm --filter mark-it-core dev
pnpm --filter mark-it-core build
pnpm --filter mark-it-core test

Repository: https://github.com/Alpha5402/mark-it

License

ISC