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

autoflow-sdk

v1.0.0

Published

AutoFlow SDK — plug autonomous incident response into any Node.js app in 3 lines

Readme

autoflow-sdk

Drop autonomous incident response into any Node.js app in 3 lines.

Install

# If published to npm:
npm install autoflow-sdk

# Or copy the sdk folder into your project:
cp -r autoflow-sdk/ your-project/

Quick Start

// ES Module
import AutoFlow from 'autoflow-sdk';

// CommonJS
const AutoFlow = require('autoflow-sdk');

const af = new AutoFlow({
  endpoint:    'http://localhost:3000/api/event',
  project:     'my-app',
  environment: 'production'
});

// Capture all uncaught errors globally
af.captureUncaughtExceptions();

// Report a specific error
try {
  await riskyOperation();
} catch (error) {
  await af.reportError(error, { source: 'payment-service', userId: req.user.id });
  throw error;
}

Configuration

| Option | Type | Default | Description | |----------------|---------|--------------------------------------|------------------------------------------| | endpoint | string | http://localhost:3000/api/event | AutoFlow backend URL | | project | string | AUTOFLOW_PROJECT env var | Your service/project name | | environment | string | NODE_ENV env var | production, staging, development | | enabled | boolean | true | Set false to disable in tests | | debug | boolean | false | Log SDK activity to console | | batchInterval| number | 0 | Batch events (ms). 0 = send immediately| | timeout | number | 5000 | HTTP timeout (ms) | | maxRetries | number | 2 | Retries on failure (exponential backoff) |

Methods

reportError(error, context?)

Report an error. Severity is auto-detected from error type and message.

await af.reportError(new Error('DB timeout'), {
  source:   'database-pool',
  severity: 'high',        // override auto-detection
  userId:   '123',
  retries:  3
});

reportEvent(type, message, severity?, metadata?)

Report any custom event — not just errors.

await af.reportEvent('warning', 'API rate limit at 90%', 'medium', {
  currentRate: 900, limit: 1000
});

await af.reportEvent('info', 'Payment processed', 'low', {
  orderId: 'ORD-123', amount: 99.99
});

health()

Check if AutoFlow backend is reachable.

const { ok, latencyMs } = await af.health();
console.log(ok ? `AutoFlow up (${latencyMs}ms)` : 'AutoFlow unreachable');

middleware()

Drop-in Express error handler — catches all errors your routes throw.

const express = require('express');
const app = express();

// your routes here...

// Add as LAST middleware
app.use(af.middleware());

captureUncaughtExceptions()

Install global handlers for crashes and unhandled promise rejections.

af.captureUncaughtExceptions(); // call once at startup

captureConsoleErrors()

Automatically report anything passed to console.error.

af.captureConsoleErrors(); // call once at startup

flush()

Force-send any batched events immediately.

await af.flush();

Batching (optional)

Send events in batches instead of one HTTP call per error — useful for high-traffic services.

const af = new AutoFlow({
  project:       'high-traffic-api',
  batchInterval: 5000  // batch and send every 5 seconds
});

// Events queue up and send every 5s automatically
// Use af.flush() to send immediately

TypeScript

Full TypeScript support is included.

import AutoFlow, { AutoFlowConfig, EventContext } from 'autoflow-sdk';

const config: AutoFlowConfig = {
  project:     'my-typescript-app',
  environment: 'production',
  debug:       true
};

const af = new AutoFlow(config);

Environment Variables

AUTOFLOW_PROJECT=my-app       # default project name
NODE_ENV=production           # default environment

What AutoFlow Does With Your Events

  1. Receives your error
  2. AI classifies severity (critical / high / medium / low)
  3. Policy engine applies your rules
  4. Decides action: ignore, monitor, auto-fix, or escalate
  5. Executes: runs fix scripts, calls webhooks, sends notifications
  6. Stores everything in SQLite for history and analytics