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

ngx-tosijs

v0.9.1

Published

Insanely simple state management for Angular — and an off-ramp from Angular. Take your pick. tosijs state as Angular signals, no zones, no RxJS plumbing, and state reachable from outside the Angular tree

Readme

ngx-tosijs

github | npm | live demo | tosijs | react-tosijs | discord

Insanely simple state management for Angular — and an off-ramp from Angular. Take your pick.

If you just want the state management: tosiSignal gives you a writable Angular signal bound to a path — no zones, no NgZone.run, no RxJS plumbing, no NgRx boilerplate — and you can talk to state from outside the Angular tree: a timer, a socket handler, the browser console, code that's never heard of Angular. If you want the off-ramp (one that otherwise basically doesn't exist): your state and logic live in tosijs — plain observable objects with no framework attached — and Angular becomes just one way of viewing them. Build new functionality on a vastly superior state management system, and migrate away from Angular as fast or as slowly as makes sense.

See it live: angular.tosijs.net runs the same Reminders app in Angular (zoneless signals) and React (react-tosijs) side by side, bound to the same state. Neither framework knows the other exists.

The off-ramp, step by step

  1. Move state and logic out of components into a tosijs proxy. This works inside your existing Angular app — any version ≥ 16, zoned or zoneless, no rewrite.
  2. Components become thin views via tosiSignal. Stores, dispatch, effects-classes, and async pipe plumbing simply stop being necessary.
  3. Build new UI as web components (tosijs-ui, or your own via tosijs Component), hosted directly in Angular templates (CUSTOM_ELEMENTS_SCHEMA — Angular hosts custom elements natively, no wrappers). They bind to the same paths as your Angular views — both stay in sync automatically, because neither owns the state.
  4. Replace remaining Angular views at your own pace. When the last one goes, delete @angular/* from package.json. Your state, logic, and new components are untouched — they never depended on Angular in the first place.

There is no step where you maintain two sources of truth, write a sync layer, or do a big-bang rewrite. (And if your escape route passes through React territory — or vice versa — react-tosijs binds the same state from React.)

tosiSignal in two minutes

import { Component } from '@angular/core'
import { xinProxy } from 'tosijs'
import { tosiSignal } from 'ngx-tosijs'

const { clock } = xinProxy({
  clock: { time: new Date().toLocaleTimeString() },
})

setInterval(() => {
  clock.time = new Date().toLocaleTimeString()
}, 1000)

@Component({
  selector: 'app-clock',
  standalone: true,
  template: `<div>{{ time() }}</div>`,
})
export class ClockComponent {
  time = tosiSignal<string>('clock.time')
}

The interval updates state outside Angular — no zone, no markForCheck, no ChangeDetectorRef — and the view follows, because tosiSignal is a real Angular signal: read it in templates, computed(), or effect(); call .set() / .update() to write through to the shared state. Cleanup is automatic via DestroyRef (create it in a component/service, or pass { injector }, or { manualCleanup: true } and call .destroy() yourself).

Works zoneless (recommended — signals notify Angular's scheduler directly) and in Zone.js apps alike.

Zone.js apps: provideTosi()

For zoned apps that read tosijs proxies directly in templates (dirty checking re-reads them every pass), provideTosi() bridges tosijs flushes into the zone so mutations from outside Angular trigger change detection — coalesced to one zone entry per flush:

bootstrapApplication(AppComponent, {
  providers: [provideTosi()],
})

Unnecessary (and harmless) in zoneless apps using tosiSignal.

Typed paths

import { typedTosi } from 'ngx-tosijs'

type AppState = {
  app: { count: number; todos: { id: string; text: string }[] }
}

const { tosiSignal } = typedTosi<AppState>()

const text = tosiSignal('app.todos[0].text') // TosiSignal<string | undefined>
const oops = tosiSignal('app.cuont')         // compile error

TosiPath<S> and TosiPathValue<S, P> are exported for building your own typed helpers.

Persistence & DevTools

Framework-free, identical to react-tosijs:

import { persist, connectDevTools } from 'ngx-tosijs'

const stop = persist('app.todos')                    // localStorage sync, coalesced writes
const disconnect = connectDevTools({ roots: ['app'] }) // Redux DevTools tap

Durable state outlives code: if the shape of a persisted value changes between releases, bump the key.

Compatibility

  • Angular >=16 <23 — the floor is API-based (signals + DestroyRef arrived in 16); the suite exercises Angular 22 (zoneless, JIT-compiled without the CLI).
  • tosijs ^1.0.6 — the library uses tosiPath/tosiValue when available (tosijs ≥ 1.1) and falls back to xinPath/xinValue on older versions.
  • A TosiSignal is a real Angular signal (isSignal() is true) with its set/update redirected to write through to tosijs.
  • SSR: tosijs needs DOM globals to load, so server rendering means a DOM-shimmed pipeline (see tosijs#18).

Development

  • bun start — build, watch, and serve the demo at http://localhost:8017
  • bun run build — one-shot build of dist/ (library) and docs/ (demo site)
  • bun test — run the test suite
  • bun run typecheck — compile-only type tests