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

@bettercommunity/bmd-editor

v3.1.0

Published

The editor for B.MD documents: a block menu with every directive, a live preview through the real renderer, phone and desktop layouts, a link checker and an HTML export, as one React component. Separate from @bettercommunity/bmd so a site that only reads

Downloads

120

Readme

@bettercommunity/bmd-editor

The editor for B.MD documents, as one React component. A block menu that knows every directive, a live preview through the real renderer, a layout that is side-by-side on a desktop and Write / Preview tabs on a phone, a link checker, an outline, the AST, and an "Export HTML" button.

It is a separate package on purpose: a site that only reads documents ships the renderer and nothing of this.

npm i @bettercommunity/bmd-editor @bettercommunity/bmd
pnpm add @bettercommunity/bmd-editor @bettercommunity/bmd

@bettercommunity/bmd is a peer: the editor previews through the renderer your site already uses, so there is one copy of it. React 18 or 19.

import { useState } from 'react';
import BmdEditor from '@bettercommunity/bmd-editor';
import '@bettercommunity/bmd/markdown.css';
import '@bettercommunity/bmd-editor/editor.css';

function Compose() {
  const [md, setMd] = useState('# Hello');
  return <BmdEditor value={md} onChange={setMd} lang="en" pageMap={pageMap} onSave={save} />;
}

Props

| Prop | What it does | |---|---| | value, onChange | the markdown, controlled | | lang | en / fr — the toolbar's words and the renderer's language | | pageMap | the renderer's page map: hover cards, [[wiki links]], and what the link checker judges internal paths against | | layout | auto (default: tabs under breakpoint, split above), split, tabs | | breakpoint | the width below which auto means tabs (900) | | height | the editing area ('60vh') | | toolbar, status | show the toolbar / the status bar | | snippetGroups | replace the block menu — same shape as SNIPPET_GROUPS | | onSave | called on Ctrl+S with the markdown | | exportTitle | the <title> of an exported page | | markdownProps | anything else for <Markdown> — roadmap, replay, radius, toc |

Keys: Ctrl+B bold, Ctrl+I italic, Ctrl+E code, Ctrl+K link, Ctrl+/ the block menu, Ctrl+S save, Tab indents.

The block menu

SNIPPET_GROUPS (also exported from ./snippets) is the list: text, callouts, layout, content, media, API & live. Each entry is { id, label, md, inline? }; ${sel} / ${sel|default} is the selection and ${cursor} is where the caret lands. expandSnippet(md, selection) does the substitution, so a host can reuse the list in a command palette.

Export

"Export HTML" fetches the renderer's stylesheet (cssUrl) and calls documentHtml() — a standalone page with the tokens, the CSS and the rendered document, downloaded as a file.

Try it

Live, in the browser: https://bettercommunity.ch/dev/editor. Changelog (shared with the renderer, the two are versioned together): https://github.com/FreeProject089/BCW/blob/master/BCWEB/packages/bmd/CHANGELOG.md.