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.11

Published

Source-canonical block Markdown editor for Svelte 5

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 Phormat styles once in your app CSS (chains phoundry-ui theme and Tailwind @source for packaged components):

@import 'phormat/styles';

Overlay setup

Phormat uses phoundry-ui context menus and inline formatting popovers. Call setupOverlays() once in your root layout and render the overlay hosts:

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

  setupOverlays();
</script>

<ContextMenuOverlay />
<PopoverOverlay>
  <!-- Optional: mount your inline toolbar as PopoverOverlay default child -->
</PopoverOverlay>

See the demo layout in this repo for a working example.

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 dirty state against your own on-disk baseline (see package usage).

Package exports

| Import | Purpose | |--------|---------| | phormat | PhormatEditor, MarkdownEditor state class, model types and helpers | | phormat/styles | CSS entry (theme + Tailwind scan) | | 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 |