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

@liquid-js/underflow

v4.1.1

Published

Markdown editor with live preview and WYSIWYG modes, CommonMark + GFM

Readme

UnderFlow

GitHub license npm scope

A markdown editor with a live preview and a WYSIWYG mode. It reads and writes CommonMark and GitHub Flavored Markdown, and its WYSIWYG mode is built on ProseMirror.

The editor keeps its focus on content: the markdown it writes is standard CommonMark/GFM that other renderers (remark, GitHub, markdown-it) display the same way, and the preview uses plain element styles so you can apply your own site's stylesheet to it.

Try it here https://liquid-js.github.io/underflow/demo/

Installation

npm install @liquid-js/underflow prosemirror-commands prosemirror-history prosemirror-inputrules \
    prosemirror-keymap prosemirror-model prosemirror-state prosemirror-transform prosemirror-view dompurify

ProseMirror and DOMPurify are peer dependencies, so your application controls their versions and loads a single copy of each.

Documentation

The guides and the API reference are at https://liquid-js.github.io/underflow/docs/.

Usage

import { Editor } from '@liquid-js/underflow'
import '@liquid-js/underflow/styles/editor.css'

const editor = new Editor({
    el: document.querySelector('#editor')!,
    height: '500px',
    initialEditType: 'markdown',
    previewStyle: 'vertical',
    initialValue: '# Hello'
})

editor.on('change', () => console.log(editor.getMarkdown()))

To only display markdown, use the viewer, which doesn't load the editing code:

import { Viewer } from '@liquid-js/underflow/viewer'
import '@liquid-js/underflow/styles/viewer.css'

new Viewer({ el: document.querySelector('#viewer')!, initialValue: '# Hello' })

The JavaScript is minified ES2024, with source maps, that leaves its dependencies to your bundler, and the stylesheets are standard CSS without vendor prefixes: add the prefixes your browser targets need in your application's build, e.g. with Autoprefixer or Lightning CSS.

In a form

The editable text is named "Markdown" or "WYSIWYG" after its mode. To name it after a form field's label, describe it, or mark it required or invalid, give it ARIA attributes with the contentAttributes option, or later with setContentAttributes(), which changes only the attributes it's given and removes the ones given as undefined. They're on the text of both modes, so they stay when the mode changes; getContentAttributes() returns them.

const editor = new Editor({
    el: document.querySelector('#editor')!,
    contentAttributes: { 'aria-labelledby': 'notes-label', 'aria-describedby': 'notes-hint', 'aria-required': true }
})

editor.setContentAttributes({ 'aria-invalid': true, 'aria-describedby': 'notes-hint notes-error' })
editor.setContentAttributes({ 'aria-invalid': undefined, 'aria-describedby': 'notes-hint' })

The attributes are aria-label, aria-labelledby, aria-describedby, aria-invalid and aria-required; false or an empty string leaves one out, and the mode's name is the aria-label unless aria-label or aria-labelledby is given.

Entry points

| Import | Contents | | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | @liquid-js/underflow | Editor, EditorCore and Viewer | | @liquid-js/underflow/viewer | Viewer | | @liquid-js/underflow/parser | The incremental markdown parser | | @liquid-js/underflow/render | renderMarkdown(), which renders markdown to HTML as the viewer does, on the server too | | @liquid-js/underflow/i18n/<locale> | UI translations, e.g. i18n/de-de | | @liquid-js/underflow/plugins/code-syntax-highlight | Syntax highlighting for code blocks | | @liquid-js/underflow/styles/editor.css | Editor UI and contents styles | | @liquid-js/underflow/styles/editor-only.css | Editor UI without the contents styles, for use with your own | | @liquid-js/underflow/styles/viewer.css | Contents styles for the viewer | | @liquid-js/underflow/styles/theme/dark.css | Dark theme, enabled with the theme: 'dark' option | | @liquid-js/underflow/styles/plugins/code-syntax-highlight.css | Styles of the syntax highlighting plugin | | @liquid-js/underflow/scss/<file> | The Sass sources of the stylesheets above, with or without the .scss extension, to compile in your own build (see Theming) |

Development

yarn install
yarn start      # demo page with the editor and viewer, served from source
yarn build      # library into lib/
yarn test       # unit and integration tests
yarn lint

See CONTRIBUTING.md for the commit conventions.

License

MIT License