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

@native-stack/nano

v1.0.0

Published

Zero-dependency persistent state machine for AI agents — powered by Node.js 24 native APIs.

Readme

@native-stack/nano

Zero-dependency persistent state machine for AI agents.

Built on Node.js 24+ native APIs — no ORMs, no bundlers, no polyfills.

zero dependencies Node.js 24+ MIT License


Why Nano?

Modern AI agents need memory that survives restarts — conversation state, tool call history, workflow progress. Most solutions pull in ORMs, key-value stores, or cloud SDKs.

Nano takes a different path: Native-First.

| Feature | Nano | Typical Alternative | |---|---|---| | Dependencies | 0 | 10–200+ | | Database | Node.js built-in node:sqlite | External install required | | Test runner | Node.js built-in node:test | Jest / Vitest / Mocha | | Module system | Native ESM | Bundler/transpiler needed | | Persistence | Atomic, WAL-mode SQLite | In-memory / ephemeral |

One import. One file. Zero setup.


Install

npm install @native-stack/nano

Requires Node.js 24 or higher. The node:sqlite module is a built-in available from Node.js 24+.


Quick Start

import { Nano } from '@native-stack/nano';

// Create a named state machine (persisted to nano.db by default)
const agent = new Nano({ name: 'support-agent' });

// Record state transitions
agent.transition('greeting', { user: 'alice', channel: 'web' });
agent.transition('collecting_info', { issue: 'billing' });
agent.transition('resolved', { resolution: 'refund issued' });

// Read the current state
console.log(agent.current);
// {
//   id: 3,
//   machine: 'support-agent',
//   state: 'resolved',
//   data: { resolution: 'refund issued' },
//   createdAt: '2026-02-16T00:00:00.000Z'
// }

// Get the full history (most recent first)
console.log(agent.history());

// Get only the last 2 transitions
console.log(agent.history(2));

// Clean up
agent.close();

API Reference

new Nano(options)

| Option | Type | Default | Description | |--------|------|---------|-------------| | name | string | required | Unique identifier for this state machine | | dbPath | string | "nano.db" | Path to the SQLite database file |

Instance Members

| Member | Type | Description | |--------|------|-------------| | .name | string | The machine name (read-only) | | .current | Snapshot \| null | Latest transition snapshot, or null if none | | .transition(state, data?) | Snapshot | Records a transition and returns the new snapshot | | .history(limit?) | Snapshot[] | Returns transitions in reverse chronological order | | .close() | void | Closes the database connection (idempotent) |

Snapshot

{
  id: number;        // Auto-incremented transition ID
  machine: string;   // State machine name
  state: string;     // State name
  data: any;         // Deserialized payload
  createdAt: string; // ISO 8601 timestamp
}

Multiple Machines, One Database

Multiple agents can share a single database file — each machine's state is fully isolated.

const planner = new Nano({ name: 'planner', dbPath: 'agents.db' });
const executor = new Nano({ name: 'executor', dbPath: 'agents.db' });

planner.transition('planning', { tasks: ['a', 'b'] });
executor.transition('idle', {});

// Each sees only its own state
console.log(planner.current.state); // 'planning'
console.log(executor.current.state); // 'idle'

Requirements

  • Node.js ≥ 24.0.0 — uses the native node:sqlite module
  • Zero runtime dependencies — nothing to install, audit, or update

License

MIT — © 2026 Native Stack