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

alambre

v1.0.4

Published

Several simple react-native code solutions.

Readme

alambre

alambre is a React Native utility library focused on reusable modules, small UI helpers, and navigation/testing playgrounds.

This repository includes a working test app (tests/) where modules and components are exercised in real screens.

Current Scope

  • Module factories to keep feature logic encapsulated:
    • createConfigProvider
    • createLangProvider
    • createLightDarkProvider
    • createApiProvider (powered by TanStack Query)
    • NavigatorProvider
    • ToastProvider
  • Navigation test flow with nested pages (home, configuration, advance, play, toast)
  • Toast provider integration with queue and custom toast component support
  • Theme switching (light/dark) with persisted storage
  • API playground in tests:
    • typed route catalog
    • generated query/mutation hooks from route definitions
    • route execution demo and structured response rendering

Project Structure (high level)

  • src/modules/: module system and domain modules
  • src/components/: base UI components and animations
  • tests/providers/: test providers for config/lang/theme/api/toast
  • tests/views/: test screens grouped by domain
  • tests/navigator/: test app navigation config and root test screen
  • App.tsx: wires providers and test screens together

Module Architecture

The project uses a class-based module architecture that separates state logic from React rendering.

Core pieces

  • BaseModule<TState>:
    • Owns module state.
    • Exposes getState() for reads.
    • Exposes subscribe() to notify observers on state changes.
    • Exposes protected setState() to update state and broadcast updates.
    • Supports optional async initialization via init().
    • Supports cleanup via dispose().
  • createModuleProvider(...):
    • Adapts a BaseModule instance to React Context.
    • Creates one module instance per provider lifecycle.
    • Subscribes React state to module updates.
    • Runs module.init() on mount.
    • Calls unsubscribe() and module.dispose() on unmount.

Data flow

  1. A provider creates one module instance.
  2. React initializes local state with module.getState().
  3. Provider subscribes with module.subscribe(setState).
  4. Module methods call setState(...).
  5. All subscribers are notified and React re-renders.
  6. On unmount, provider unsubscribes and disposes module resources.

This keeps state transitions centralized in classes while preserving React's declarative rendering.

Domain Modules

  • config:
    • Persists and updates simple string config fields.
    • Exposes config and saveField.
  • lang:
    • Persists selected language key.
    • Exposes lang, currentLang, and changeLang.
  • theme:
    • Persists current theme name (light or dark).
    • Exposes theme, currThemeName, toggleTheme, and setThemeName.
  • api:
    • Generates typed routes and query/mutation hooks.
    • Wraps TanStack Query setup and request helpers.
  • navigator:
    • Stores page stack and scroll state.
    • Exposes navigation actions and current page metadata.
  • toast:
    • Handles toast queue, timers, and lifecycle.
    • Renders a required client ToastComponent.

Quick Start

Install dependencies:

npm install

Run the test app:

npm run android

Other useful scripts:

npm run lint
npm run build