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

tabs-state-sync

v0.1.1

Published

it is a tiny React hook that makes your app state instantly sync across tabs

Readme

🧠 tabs-state-sync

NPM version NPM downloads

Because your tabs should talk behind your back — constructively.


🧐 What is this?

You ever open your app in two tabs and change the theme in one, but the other tab just… doesn’t get it?
Rude.

tabs-state-sync is a tiny React hook that makes your app state instantly sync across tabs. No Redux. No context. No tears. Just vibes.

const [theme, setTheme] = useSyncedState('theme', 'light');

🚀 Why should I care?

Imagine:

  • Tab A logs out.
  • Tab B still thinks it’s logged in.
  • You scream.
  • tabs-state-sync prevents that scream.

⚡ Install

npm install tabs-state-sync

Or yarn, if you're into that sort of thing.


🔮 Usage

import { useSyncedState } from 'tabs-state-sync';

function ThemeToggle() {
  const [theme, setTheme] = useSyncedState('theme', 'light');

  return (
    <button onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}>
      Theme: {theme}
    </button>
  );
}

Then open another tab. Click the button. Watch it sync like it’s 1999.


🧯 Use Cases (aka excuses to use this)

  • Theme toggles 🌒
  • Auth state 🔓
  • Filter settings 📊
  • Cart state 🛒
  • That one weird internal tool where people keep opening 6 tabs 🤡

✨ API

const [state, setState] = useSyncedState<T>(key: string, defaultValue: T)
  • key: your gossip channel name (aka the storage key)
  • defaultValue: the fallback for tab #1 or when localStorage is empty

Returns [state, setState] — just like useState, but it has friends.


⚠️ Caveats (Read or Rage Later)

  • Incognito tabs are loners — they won’t play along

📦 What’s Inside?

  • React + Hooks 🪝
  • TypeScript support 🦾
  • localStorage wizardry ✨
  • Zero dependencies (unless you count trust issues)

🧘 Philosophy

Simplicity over ceremony. Zero-config. Zero drama. Cross-tab peace ✌️ at last.


🧑‍💻 Author

Built by cinfinit — dev, tab hoarder, and certified "why isn’t this syncing?!" survivor.

When not building small libraries to solve oddly specific problems, you can find them:

  • Breaking things to learn how they work
  • Arguing with TypeScript like it’s a sentient roommate
  • Forgetting they had another tab open… with the same app , EVERYDAY story , i mean literally everyday
  • Writing code that eventually deletes itself (via git rebase)

Got feedback, feature ideas, or just want to say “yo this is dope”? PRs and DMs are always welcome.