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

@joewinke/jatui

v0.2.33

Published

Shared Svelte 5 component library for JAT projects

Readme

@joewinke/jatui

Shared Svelte 5 component library for JAT projects.

Installation

npm install @joewinke/jatui

Requires Svelte 5 and DaisyUI 5 as peer dependencies.


Dialog Utilities

ConfirmDialog and InputDialog are global, promise-based dialogs that replace the browser's native confirm() / prompt(). They're keyboard-accessible, animated, and theme-aware.

Setup — wire into root layout

Mount both components once at the app root so they're always available:

<!-- src/routes/+layout.svelte -->
<script>
  import { ConfirmDialog, InputDialog } from '@joewinke/jatui';
</script>

<slot />

<ConfirmDialog />
<InputDialog />

showConfirm(opts)Promise<boolean>

Shows a modal confirmation dialog. Resolves true if the user confirms, false if they cancel or the timeout expires.

import { showConfirm } from '@joewinke/jatui';

const ok = await showConfirm({
  title: 'Delete project?',
  body: 'This cannot be undone.',
  danger: true,
  timeoutMs: 10000,         // auto-cancel after 10 s; progress bar drains to zero
  confirmLabel: 'Delete',   // default: 'Confirm' (danger) / 'OK' (non-danger)
  cancelLabel: 'Keep',      // default: 'Cancel'
});

if (ok) {
  await deleteProject(id);
}

Options (ConfirmOptions):

| Option | Type | Default | Description | |---|---|---|---| | title | string | required | Dialog heading | | body | string | — | Supporting detail text | | danger | boolean | true | Red styling + terminal icon when true; info styling otherwise | | timeoutMs | number | 8000 | Auto-cancel after this many ms; 0 disables the timer | | confirmLabel | string | 'Confirm' / 'OK' | Confirm button label | | cancelLabel | string | 'Cancel' | Cancel button label |

Keyboard: Enter confirms · Escape cancels · focus starts on Cancel (safe default for destructive actions).


showInput(opts)Promise<string | null>

Shows a modal text-input dialog. Resolves with the typed string on confirm, null on cancel.

import { showInput } from '@joewinke/jatui';

const name = await showInput({
  title: 'Rename project',
  body: 'Enter a new name for this project.',
  placeholder: 'My project',
  maxLength: 60,
  validate: (v) => v.trim().length < 2 ? 'Name must be at least 2 characters.' : null,
});

if (name !== null) {
  await renameProject(id, name.trim());
}

Options (InputOptions):

| Option | Type | Default | Description | |---|---|---|---| | title | string | required | Dialog heading | | body | string | — | Supporting detail text | | placeholder | string | — | Input placeholder text | | maxLength | number | — | maxlength cap on the input field | | validate | (value: string) => string \| null | — | Return an error message to block submission, null to allow it | | confirmLabel | string | 'OK' | Confirm button label | | cancelLabel | string | 'Cancel' | Cancel button label |

Keyboard: Enter submits (runs validate first) · Escape cancels · input is focused on open.


Migration guide — replacing native confirm() / prompt()

- if (!confirm('Are you sure you want to delete this?')) return;
+ if (!await showConfirm({ title: 'Delete this?', danger: true })) return;
- const name = prompt('Enter a new name:', currentName);
- if (name === null) return;
+ const name = await showInput({ title: 'Rename', placeholder: currentName });
+ if (name === null) return;

Both dialogs are non-blocking (await), keyboard-navigable, and respect the app's DaisyUI theme. Unlike native dialogs they don't pause the JavaScript event loop.