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

@atolljs/nextjs

v0.1.14

Published

Next.js bindings — React hooks for client components

Readme

@atolljs/nextjs

CI codecov Socket Badge

Next.js bindings for @atolljs/core — the @atolljs/react hooks re-exported for App Router apps. Same signatures, imported by client components under a 'use client' boundary. SSR-safe: field reads return undefined until the contract binds on the client.

Atoll — package documentation

Install

npm install @atolljs/core @atolljs/nextjs

Usage

'use client';   // required — the hooks read browser-side state

import { useSharedValue, useTask } from '@atolljs/nextjs';
import { counterMemory } from '../counter.memory';
import { counter } from '../counter';   // connectWorker client — safe to import under SSR

export function Counter() {
  const count = useSharedValue(counterMemory, 'count');
  const increment = useTask(counter.increment);  // client method → latest-wins task

  return (
    <button onClick={() => increment.run(1)}>
      count: {count ?? '…'}
    </button>
  );
}

API

Same surface as @atolljs/react:

  • useObservable(source) — subscribe to any ObservableValue snapshot.
  • useSharedValue(memory, key, select?, options?) — bind one shared-memory field to React state; optional selector + equals.
  • useTask(task | asyncFn) — bind an AsyncTask (or any async fn) to { data, pending, settled, elapsedMs, error } plus run/runOnce.

Notes

  • 'use client' is required on any component calling the hooks; page.tsx can stay a server component that just renders it.
  • The connectWorker client is SSR-safe to import — its pool spawns lazily on the first method call, never during a server render.
  • COOP/COEP headers in next.config.ts are only needed when the pool uses sharedMemory; a message-only pool needs neither headers nor SharedArrayBuffer.
  • Server-side pools work too: route handlers run on Node, so @atolljs/node (createNodePool/createNodeWorker) gives a handler its own node:worker_threads pool — see examples/nextjs/src/app/api/atoll/.
  • Requires a Node runtime (next start, a Node host, Vercel) — static file hosts can't render the app or answer route handlers.

Documentation