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

phormat

v0.0.32

Published

Source-canonical block Markdown editor for Svelte 5

Downloads

1,715

Readme

Phormat

Source-canonical block Markdown editor for Svelte 5. Markdown source is the persisted representation; a typed block tree is the in-memory editing model.

Monorepo note: The npm package is phormat. This repository folder may still be named md-editor.

Install

npm install phormat

Peer dependencies (install in your app):

  • svelte ^5.0.0
  • phoundry-ui >=0.0.18
  • @iconify/svelte ^4.0.0 || ^5.0.0

In a Phoundry monorepo, use a file: dependency (e.g. "phormat": "file:../md-editor") and run npm run prepack in this repo after editing package source.

Publishing

Maintainers: see docs/publishing.md. Quick path: npm run release after npm login and ensuring phoundry-ui@>=0.0.18 is on npm.

Styles

Import phoundry-ui styles (host-owned) plus Phormat’s editor CSS / Tailwind @source scan:

@import 'phoundry-ui/styles';
@import 'phoundry-ui/themes/default-dark/theme.css';
@import 'phormat/styles';

phormat/styles does not re-import phoundry-ui — that keeps the host’s selected UI package authoritative when nested copies exist.

Overlay setup

Phormat uses phoundry-ui mono icons, context menus, and inline formatting popovers. Register the mono collection, call setupOverlays() once in your root layout, and render the overlay hosts:

<script>
  import { ContextMenuOverlay, PopoverOverlay, setupOverlays } from 'phoundry-ui';
  import { registerPhoundryMono } from 'phoundry-ui/icons';

  registerPhoundryMono();
  setupOverlays();
</script>

<ContextMenuOverlay />
<PopoverOverlay />

Phormat opens the inline formatting toolbar and link-edit chrome via popover.open({ content }) — empty PopoverOverlay is enough. Optional package exports InlineFormattingToolbar / LinkEditPopoverHost remain for hosts that prefer default-child mounting. See the demo layout.

Quick start

<script>
  import { PhormatEditor } from 'phormat';

  let source = $state('# Hello\n\nEdit me.');
</script>

<PhormatEditor value={source} onchange={(next) => (source = next)} />

For file-backed apps, the parent owns load/save and passes value / onchange; call markSaved() on the internal state only if you use MarkdownEditor directly. With PhormatEditor, track persistence against your own on-disk baseline and use bind:embedder to prepare a focused inline draft before writing or closing (see package usage).

Package exports

| Import | Purpose | |--------|---------| | phormat | PhormatEditor, InlineFormattingToolbar, LinkEditPopoverHost, MarkdownEditor state class, model types and helpers | | phormat/styles | Editor CSS + Tailwind @source for packaged Phormat components (host imports phoundry-ui/styles) | | phormat/demo | Browser-only demo helpers (file load, localStorage drafts, download) — not for production file I/O |

Documentation

Demo app

npm install
npm run dev

Dev server: http://127.0.0.1:5181/ (pinned with strictPort; see vite.config.ts). If you see the Phoundry marketing site instead, a stale phoundry-website dev server is squatting on 5181 — stop it and restart Phormat.

The SvelteKit route at src/routes/+page.svelte is a reference implementation using phormat/demo for browser file upload, draft recovery, and export.

Scripts

| Command | Description | |---------|-------------| | npm run dev | Demo dev server | | npm run check | Typecheck | | npm run test | Unit tests | | npm run prepack | Build library (dist/) | | npm run pack:local | Build + create .tgz for inspection | | npm run release | Patch version, build, npm publish |