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

@trap_stevo/logictide

v0.0.2

Published

Command logic flow with precision—trigger, replay, and persist dynamic behaviors across environments (development, staging, production, etc), namespaces, and sessions. Define environment-scoped logic, embed TTL, recover snapshots, and execute real-time de

Readme

🌊 LogicTide

Channel the tide of logic itself—construct modular intent, replay echoes of logic, and architect environments that remember.


💡 Description

Command the flow of logic with legendary clarity and precision. Trigger, replay, and orchestrate behaviors across infinite namespaces with modular power and graceful structure. Define dynamic behaviors, emit real-time signals, and preserve intent across sessions, devices, and environments.

Switch effortlessly between development, staging, production—or any custom environment—and execute scoped logic tailored to context. Embed TTL-based expiration, snapshot recovery, and namespace isolation to enforce resilience at scale. Streamline adaptive workflows, synchronize distributed systems, and sculpt intelligent decision paths with confidence. Orchestrate logic itself—rewind, adapt, and execute with legendary precision across environments, time, and structure.


🚀 Features

  • Scoped Logic Execution — Run logic conditionally based on the current environment (development, staging, production, etc).
  • 🌐 Namespace Support — Isolate and manage logic across distinct namespaces.
  • 🔁 Event Replay — Replay past events programmatically for debugging, analytics, or reactivity.
  • 🧠 Snapshot + Restore — Capture and restore in-memory logic history anytime.
  • 🗂️ TTL Expiration — Set lifespans for stored events to keep logic lean and relevant.
  • 📦 Persistence — Use LevelDB (Node) or IndexedDB (Browser) to store and retrieve logic history.
  • 📂 Import / Export — Easily back up and load event history via JSON files or buffers.
  • 🧩 Modular API — Override behaviors, plug into different runtimes, and remain fully environment-agnostic.

📐 Specifications

Modes & Environments

| Feature | Description | |---------------------|-----------------------------------------------------------| | setMode(mode) | Define the active logic environment (dev, prod, etc) | | runSync(scope, ...) | Execute logic defined for the current mode (sync) | | run(scope, ...) | Execute logic defined for the current mode (async / sync) | | defineLogic(...) | Attach logic to a specific mode and scope |


Namespaces

| Feature | Description | |---------------------------|-----------------------------------------------------------| | setNamespace(ns) | Switch to a new logical space for isolating events | | getNamespace() | Retrieve the current active namespace | | listNamespaces() | List all known namespaces stored in persistence | | deleteNamespace(ns) | Remove all events under a namespace | | renameNamespace(from, to) | Rename a namespace (preserves events) | | copyNamespace(from, to) | Duplicate a namespace and its events |


Event Management

| Feature | Description | |----------------------------|----------------------------------------------------------| | emit(event, ...args) | Trigger a logic event | | on(event, cb) | Attach listener for a specific or wildcard event | | off(event, cb) | Remove a listener | | replayEvents(...) | Replay historical events with filtering & options | | setHistorySize(n) | Define max number of events kept in memory | | snapshot() | Get a deep copy of current in-memory event state | | restore(snapshot, opts) | Restore events from a snapshot |


Persistence

| Feature | Description | |-----------------------------------|---------------------------------------------------------| | enablePersistence(opts) | Enable LevelDB/IndexedDB-backed persistence | | clearPersistence() | Delete all stored events in the current namespace | | exportEventHistory({ format }) | Export as JSON array or UTF-8 buffer | | exportToFile(path) | Save all logic events to file | | importFromFile(path, opts) | Load event history from file | | purgeExpiredEvents({ namespace }) | Clean TTL-expired events across one or all namespaces |


🧪 Example (NodeJS)

const LogicTide = require("@trap_stevo/logictide");

await LogicTide.enablePersistence({
      path : "./logic-db",
      ttl : 1000 * 60 * 60,
      namespace : "projectX"
});

LogicTide.setMode("staging");

LogicTide.defineLogic("paymentHandler", "production", async (id) => {
      return { token : id, secure : true };
});

LogicTide.defineLogic("paymentHandler", "staging", async () => {
      return { token : "test-token", secure : false };
});

const result = await LogicTide.run("paymentHandler", "tok_abc");
console.log(result); // { token: "test-token", secure: false }

await LogicTide.emit("user.login", { userID : "ABC" });
await LogicTide.replayEvents("user.*");

await LogicTide.exportToFile({ filename : "backup.json" });

🧪 Example (Browser)

import { LogicTide } from "@trap_stevo/logicTide";

await LogicTide.enablePersistence({
      dbName : "LogicTideDB",
      ttl : 1000 * 60 * 60,
      namespace : "ui-events"
});

LogicTide.setMode("staging");

LogicTide.defineLogic("paymentHandler", "production", (id) => {
      return { token : id, secure : true };
});

LogicTide.defineLogic("paymentHandler", "staging", () => {
      return { token : "test-token", secure : false };
});

const result = await LogicTide.run("paymentHandler", "tok_abc");
console.log(result); // { token: "test-token", secure: false }

await LogicTide.emit("user.login", { userID : "ABC" });
await LogicTide.replayEvents("user.*");

// Trigger file export in browser
await LogicTide.exportToFile({ filename : "backup.json" });

// To import from file input element
const input = document.querySelector("#importFile");
input.addEventListener("change", async (e) => {
      const file = e.target.files[0];
      await LogicTide.importFromFile(file, { persist: true });
});

📦 Installation

npm install @trap_stevo/logictide

Supports:

  • Node.js
  • Plain Javascript

🧭 Roadmap

  • [ ] Auto-purge expired events on interval
  • [ ] WebSocket broadcast support
  • [ ] Logic chaining and reactive transforms
  • [ ] Real-time visual debugger

🛡 License

See license in LICENSE.md