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

@viewengine/elm-clerk

v2.0.0

Published

ClerkJS shim for Elm apps: bridges @clerk/clerk-js to two Elm ports.

Readme

@viewengine/elm-clerk

The npm half of elm-clerk: a small ESM shim that loads @clerk/clerk-js and bridges it to a compiled Elm app over two ports. Pair it with the Elm package alexbruf/elm-clerk.

Install

bun add @viewengine/elm-clerk        # pulls @clerk/clerk-js ^6.31.0

ESM only. No CommonJS build.

Use

Paste the canonical Ports.elm into your Elm app:

port module Ports exposing (clerkIn, clerkOut)

import Json.Encode exposing (Value)

port clerkOut : Value -> Cmd msg
port clerkIn : (Value -> msg) -> Sub msg

Then wire the shim once, after Elm.Main.init:

import { attachClerk } from '@viewengine/elm-clerk';

const app = Elm.Main.init({ node: document.getElementById('root') });

const clerk = await attachClerk(app, {
  publishableKey: import.meta.env.VITE_CLERK_PUBLISHABLE_KEY,
  // clerkOptions: { signInUrl: '/sign-in' },   // passed straight to clerk.load()
  // ports: { out: 'clerkOut', in: 'clerkIn' }, // these are the defaults
  // ui: 'cdn',                                  // default; 'none' for headless
});

attachClerk resolves with the loaded Clerk instance. It rejects only when the named ports are missing from app.ports, when the Clerk UI bundle cannot be fetched, or when clerk.load() fails. All three happen in your own setup code, before Elm is involved. After that, nothing ever throws into the Elm runtime: every failure arrives on clerkIn as { v: 1, tag: "error", message }.

Prebuilt UI

ClerkJS 6 does not bundle its UI components. With the default ui: 'cdn', the shim injects https://<frontend-api>/npm/@clerk/ui@1/dist/ui.browser.js (the host is decoded from the publishable key) and passes the resulting constructor as clerkOptions.ui.ClerkUI, which is what mountSignIn, mountUserButton, openSignIn, openSignUp, and openUserProfile need. This mirrors Clerk's own JavaScript quickstart and avoids a React peer dependency. Options:

  • ui: 'none': skip the bundle. State and requestToken still work; the mount/open commands reply with an error message.
  • Supply clerkOptions.ui.ClerkUI yourself (for example from @clerk/ui if your app already bundles React) and the CDN step is skipped.
  • uiBundleUrl(publishableKey) and frontendApiFromKey(publishableKey) are exported if you need the URL for a Content Security Policy.

API

| Export | What it is | |--------|-----------| | attachClerk(app, opts) | Loads ClerkJS and bridges the two ports. Also the default export. | | ElmApp, ElmPort, AttachOptions, ClerkOptions | Types for the call above. | | PROTOCOL_VERSION, OUTGOING_TAGS, INCOMING_TAGS | The v1 wire protocol tables. | | serializeState, parseOutgoing, stateChanged, tokenReceived, tokenFailed, error | Protocol helpers, re-exported from ./protocol. | | State, UserJson, SessionJson, OrganizationJson, message types | Protocol types. |

The wire protocol itself (all nine Elm to JS tags, all four JS to Elm tags, and the State JSON) is documented in the root README and CLAUDE.md.

Develop

bun install
bun run typecheck
bun run test     # vitest + jsdom, @clerk/clerk-js mocked at the module boundary
bun run build    # tsc -> dist/

BSD-3-Clause.