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

@jswork/ppt-slidebridge

v1.0.5

Published

Typed postMessage SDK for remote-controlling embedded PPT/slide iframes across origins.

Readme

ppt-slidebridge

Typed postMessage SDK for remote-controlling embedded PPT/slide iframes across origins.

version license download

installation

yarn add @jswork/ppt-slidebridge

usage

Host side (your app that embeds the player)

import { HostBridge } from "@jswork/ppt-slidebridge";

const host = new HostBridge(iframeEl, { targetOrigin: "https://player.example.com" });

// resolved when the player announces itself (auto-retried until handshake)
const { total } = await host.whenReady();

host.next();
host.prev();
host.goto(3);

host.onPageChange((index, total) => console.log(`slide ${index + 1}/${total}`));

const { index } = await host.getPage();

Player side (inside the embedded PPT iframe)

import { PlayerBridge } from "@jswork/ppt-slidebridge";

const player = new PlayerBridge({
  goto: (index) => showSlide(index),
  next: () => showSlide(index + 1),
  prev: () => showSlide(index - 1),
  getPage: () => ({ index }),
});

player.emitReady(totalSlides);
player.emitPageChange(index, totalSlides);

React hooks

import { useRef } from "react";
import { useHostBridge } from "@jswork/ppt-slidebridge";

function Demo() {
  const iframeRef = useRef<HTMLIFrameElement>(null);
  const { host, ready, index, total, canPrev, canNext } = useHostBridge(iframeRef, { targetOrigin: "*" });

  return (
    <>
      <button disabled={!ready || !canPrev} onClick={() => host?.prev()}>Prev</button>
      <button disabled={!ready || !canNext} onClick={() => host?.next()}>Next</button>
      <iframe ref={iframeRef} src="/player.html" />
    </>
  );
}

Also available: usePlayerBridge(commands) and usePageChange(host).

useHostBridge exposes the same navigation surface as useViewerControls: go/goto/next/prev/first/last plus canPrev/canNext. Slide index is 0-based (0 <= index < total); display {index + 1}/{total} in UI. go(direction) takes only 1 (next) or -1 (prev); multi-page jumps use goto (can* are false until ready).

useViewerControls

Headless pagination controls shared by viewer UIs (0-based page index):

const ctrl = useViewerControls({
  total: pages.length,
  keyboard: true, // optional: ArrowLeft/ArrowRight
  player, // optional: PlayerBridge from usePlayerBridge; next/prev/goto/first/last are forwarded
});

// ctrl: { index, total, canPrev, canNext, go, goto, first, last }
// render `${ctrl.index}/${ctrl.total}` directly, no +1 needed

Controlled mode: pass index + onChange and keep state in your component. total === 0 disables all actions.

Vue 3 composables

<script setup>
import { ref } from "vue";
import { useHostBridgeVue } from "@jswork/ppt-slidebridge";

const iframeRef = ref(null);
const { host, ready, index, total, canPrev, canNext } = useHostBridgeVue(iframeRef, { targetOrigin: "*" });
</script>

<template>
  <button :disabled="!ready || !canPrev" @click="host?.prev()">Prev</button>
  <button :disabled="!ready || !canNext" @click="host?.next()">Next</button>
  <iframe ref="iframeRef" src="/player.html" />
</template>

Also available: usePlayerBridgeVue(commands).

useHostBridgeVue exposes the same navigation surface as useViewerControls: go/goto/next/prev/first/last plus canPrev/canNext. Slide index is 0-based (0 <= index < total); display {index + 1}/{total} in UI. go(direction) takes only 1 (next) or -1 (prev); multi-page jumps use goto (can* are false until ready).

Runnable demos (host + player) live in the monorepo: apps/example-react and apps/example-vue — run pnpm dev inside either.

license

Code released under the MIT license.