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

reatom-naming-plugin

v0.1.0

Published

Babel & Vite plugin that auto-injects debug names into Reatom factories (atom, action, computed, reatom*) from the variable/property name.

Readme

reatom-naming-plugin

A Babel & Vite plugin that automatically adds debug names to Reatom units, so you don't have to write them by hand.

const count = atom(0)               // →  atom(0, "count")
const doubled = computed(() => …)   // →  computed(…, "doubled")
const increment = action(() => …)   // →  action(…, "increment")

The name is taken from the variable or property the unit is assigned to. It works for atom, action, computed, reaction and every reatom* factory (reatomBoolean, reatomForm, …), but only for identifiers imported from a @reatom/* package.

Install

npm i -D reatom-naming-plugin

The plugin ships no runtime dependencies. @babel/core is an optional peer:

  • The Babel entry needs nothing extra — your own Babel runs the plugin.
  • The Vite entry needs @babel/core (loaded lazily). Most Vite + React setups already have it via @vitejs/plugin-react; otherwise add it: npm i -D @babel/core. It is build-time only and never enters your bundle.

Usage

Vite

// vite.config.ts
import { reatomNaming } from 'reatom-naming-plugin/vite'

export default {
  plugins: [reatomNaming()],
}

Babel

// babel.config.json
{ "plugins": ["reatom-naming-plugin/babel"] }

Options

All options are optional — the defaults work out of the box.

reatomNaming({
  naming: 'convention',
  factories: /^(reatom\w+|atom|action|reaction|computed)$/,
  importSources: [/^@reatom\//],
  domainVariable: 'name',
})

naming — how detailed the names are

Default: 'convention'.

  • 'variable' — just the variable / property name.

    const count = atom(0)            // →  atom(0, "count")
    const form = { email: atom('') } // →  atom('', "email")
  • 'convention' — adds context with dots, the same way @reatom/eslint-plugin does. A property gets its object's name as a prefix:

    const count = atom(0)            // →  atom(0, "count")
    const form = { email: atom('') } // →  atom('', "form.email")  ← note the prefix

factories — which functions get named

Default: /^(reatom\w+|atom|action|reaction|computed)$/ (covers atom, action, computed, reaction, and every reatom*).

Pass a RegExp or an explicit list to change it:

reatomNaming({ factories: ['atom', 'action'] }) // only these two

importSources — where those functions must come from

Default: [/^@reatom\//] — only names units imported from a @reatom/* package, so a same-named action() from another library is left alone.

reatomNaming({ importSources: ['my-state-lib'] }) // also treat this lib's exports
reatomNaming({ importSources: false })            // match by name only, ignore imports

domainVariable — the per-instance prefix in factories

Default: 'name'. Only relevant in 'convention' mode.

When you write your own reatom* factory that takes a name argument, the plugin builds a dynamic name from it, so every instance is distinguishable:

const reatomUser = (name) => {
  const age = atom(0)              // →  atom(0, `${name}.age`)
}
reatomUser('user1') // this instance's atom is "user1.age"
reatomUser('user2') // this one is "user2.age"

If your factories use a different parameter name (e.g. id), point the option at it:

reatomNaming({ domainVariable: 'id' }) // const reatomUser = (id) => atom(0, `${id}.age`)

Vite-only options

  • apply — when the transform runs. 'all' (default), 'serve' (dev only, names stripped from the production build), or 'build' (prod only).
  • include / exclude — which files to process. Defaults: /\.[cm]?[jt]sx?$/ and /node_modules/.

Notes

  • Units that already pass a name are left untouched.
  • The name is only appended as an argument — object initial state like atom({ name: 'John' }) is never modified.
  • Naming follows the @reatom/eslint-plugin convention.

License

MIT