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

@hasna/slides

v0.1.0

Published

Headless presentation-deck SDK for Hasna-coded apps — author slides in Markdown or HTML, model themes/transitions/fragments/vertical stacks, serialize to JSON, and export a self-contained reveal.js HTML deck. Ships a React reveal.js viewer at @hasna/slide

Readme

@hasna/slides

npm license

Headless presentation-deck SDK for Hasna-coded apps. Author slides in Markdown or HTML, model themes / transitions / fragments / vertical stacks, serialize to JSON, and export a self-contained reveal.js HTML deck. A React viewer is shipped separately at @hasna/slides/react.

The local project folder is open-slides; the published package is @hasna/slides and the GitHub repository is hasna/slides.

  • @hasna/slides — the headless, framework-agnostic deck model + serialization + HTML export. No React, safe to run server-side.
  • @hasna/slides/react — a reveal.js-backed <Presentation> / <Deck> viewer component (arrow-key navigation, overview mode, fragments, speaker notes).

Built on reveal.js 6.0.1 (MIT). This package is MIT-licensed.

Install

bun add @hasna/slides
# React viewer peers (only if you use @hasna/slides/react)
bun add react react-dom

Headless SDK

import { createDeck, exportDeckHtml, serializeDeck } from "@hasna/slides";

const deck = createDeck({ title: "Launch", theme: "moon" });

const intro = deck.addSlide({ body: "# Launch\n\nA new way to ship" });
deck.setNotes(intro.id, "Open warm, then get to the point.");

deck.addSlide({
  body: "<h2>Highlights</h2>",
  format: "html",
  fragments: ["Fast", "Simple", "Composable"],
});

// A vertical stack (down-arrow navigation)
const detail = deck.addSlide({ body: "## Deep dive" });
deck.addChild(detail.id, { body: "### Architecture" });

// Persist as JSON …
const json = serializeDeck(deck.toJSON());

// … or export a standalone reveal.js HTML file
const html = deck.toHtml();            // CDN-referenced, portable
await Bun.write("launch.html", html);

Author from Markdown

parseMarkdownDeck follows the reveal.js Markdown convention:

  • --- on its own line starts a new horizontal slide.
  • -- on its own line starts a vertical sub-slide.
  • Note: starts speaker notes that run to the end of the slide.
import { createDeck, parseMarkdownDeck } from "@hasna/slides";

const slides = parseMarkdownDeck(`
# Title

Welcome

Note: smile

---

## Agenda

- one
- two
`);

const deck = createDeck({ title: "Standup", slides });

Self-contained export

By default exportDeckHtml references a pinned reveal.js build on jsDelivr, producing a single portable HTML file. Pass an inline asset bundle to produce a fully offline, self-contained file:

import { exportDeckHtml } from "@hasna/slides";
import { readFileSync } from "node:fs";

const req = (p: string) => readFileSync(require.resolve(`reveal.js/${p}`), "utf8");

const html = exportDeckHtml(deck.toJSON(), {
  assets: {
    revealCss: req("dist/reveal.css"),
    themeCss: req("dist/theme/black.css"),
    revealJs: req("dist/reveal.js"),
    markdownJs: req("plugin/markdown/markdown.js"),
    notesJs: req("plugin/notes/notes.js"),
  },
});

React viewer

import { Presentation } from "@hasna/slides/react";
import { createDeck, parseMarkdownDeck } from "@hasna/slides";

const deck = createDeck({ slides: parseMarkdownDeck(source) });

export function Preview() {
  return <Presentation deck={deck} theme="black" embedded />;
}

The viewer dynamically imports reveal.js inside an effect, so it is safe in SSR frameworks (nothing reveal-related runs on the server). It provides arrow-key navigation, overview mode (O), fragments, and the speaker-notes view (S) out of the box.

Dashboard

dashboard/ is a Vite + React studio that demonstrates the SDK end to end: author a deck in Markdown with a live reveal.js preview, read per-slide speaker notes, switch themes, and export a self-contained HTML deck or JSON.

cd dashboard
bun install
bun run dev

Concepts

| Concept | API | | --- | --- | | Create / load a deck | createDeck, loadDeck | | Slide CRUD | deck.addSlide, updateSlide, removeSlide, moveSlide | | Vertical stacks | deck.addChild(parentId, …) | | Speaker notes | deck.setNotes(id, …) | | Fragments | slide.fragments: string[] | | Theme / config | deck.setTheme, deck.setConfig | | Markdown authoring | parseMarkdownDeck, slidesToMarkdown | | Serialize | serializeDeck, deserializeDeck | | HTML export | exportDeckHtml, deck.toHtml() | | React viewer | @hasna/slides/react<Presentation> |

See docs/sdk.md, docs/react.md, and docs/export.md for details.

Status

Functional v1: headless deck SDK, Markdown authoring, JSON serialization, standalone HTML export, and the React reveal.js viewer.

Deferred (optional scaffolding, tracked in hasna.contract.json): CLI, MCP server, HTTP slides-serve API, and Postgres persistence.

License

MIT © Hasna. reveal.js is © Hakim El Hattab and contributors, MIT.