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

@ngstato/core

v0.4.2

Published

Stato — Zero-dependency state management engine

Readme

@ngstato/core

Tired of 14 lines of RxJS for a simple API call?

Write async/await. Get the same result. Ship ~3 KB instead of ~50 KB.

npm gzip tests license

Documentation · API Reference · Helpers


Before / After

NgRx — rxMethod + pipe + tap + switchMap + from + tapResponse + patchState:

load: rxMethod<void>(pipe(
  tap(() => patchState(store, { loading: true })),
  switchMap(() => from(service.getAll()).pipe(
    tapResponse({
      next:  (users) => patchState(store, { users, loading: false }),
      error: (e)     => patchState(store, { error: e.message })
    })
  ))
))

ngStato — async/await:

async load(state) {
  state.loading = true
  state.users   = await http.get('/users')
  state.loading = false
}

Install

npm install @ngstato/core

30-second example

import { createStore } from '@ngstato/core'

const store = createStore({
  count: 0,
  
  selectors: { doubled: (s) => s.count * 2 },
  
  actions: {
    inc(state)                { state.count++ },
    add(state, n: number)    { state.count += n },
    async load(state)        { state.count = await fetchCount() }
  }
})

await store.inc()
store.count      // 1
store.doubled    // 2 (memoized)

Real-world store

import { createStore, http, retryable, optimistic } from '@ngstato/core'

const store = createStore({
  users:   [] as User[],
  loading: false,
  error:   null as string | null,

  selectors: {
    total:  (s) => s.users.length,
    admins: (s) => s.users.filter(u => u.role === 'admin')
  },

  actions: {
    loadUsers: retryable(async (state) => {
      state.loading = true
      state.users   = await http.get('/users')
      state.loading = false
    }, { attempts: 3, backoff: 'exponential' }),

    deleteUser: optimistic(
      (state, id: string) => { state.users = state.users.filter(u => u.id !== id) },
      async (_, id)       => { await http.delete(`/users/${id}`) }
    )
  },

  hooks: {
    onInit:  (store) => store.loadUsers(),
    onError: (err, name) => console.error(`[${name}]`, err.message)
  }
})

Concurrency — without RxJS

import { exclusive, abortable, queued, retryable, optimistic } from '@ngstato/core'

actions: {
  submit: exclusive(async (s) => { ... }),             // → exhaustMap
  search: abortable(async (s, q, { signal }) => { }),  // → switchMap
  send:   queued(async (s, msg) => { ... }),            // → concatMap
  load:   retryable(async (s) => { ... }, opts),        // → retryWhen
  delete: optimistic(apply, confirm),                   // → manual in NgRx
}

Plus debounced · throttled · distinctUntilChanged · forkJoin · race · combineLatest · fromStream · pipeStream + 12 stream operators · createEntityAdapter · withEntities · withPersist · mergeFeatures · on()Full API →

Inter-store reactions

import { on } from '@ngstato/core'

on([userStore.create, userStore.delete], (_, event) => {
  console.log(`${event.name} ${event.status} in ${event.duration}ms`)
})

Feature composition

const store = createStore({
  items: [] as Item[],
  ...mergeFeatures(withLoading(), withPagination()),
  actions: { async load(state) { ... } }
})
// store.loading, store.page, store.hasError — all available

The numbers

| | NgRx v21 | ngStato | |:--|:--|:--| | Bundle | ~50 KB | ~3 KB | | CRUD store | ~90 lines | ~45 lines | | Concepts for async | 9 | 1 | | RxJS required | Yes | No |

📖 Documentation

becher.github.io/ngStatoQuick start · Core concepts · API · Helpers · NgRx migration

License

MIT