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

trustflow-sdk

v1.0.0

Published

TrustFlow SDK for Node.js — ship HTTP logs to your TrustFlow threat detection dashboard. Zero dependencies.

Readme

trustflow-sdk

TrustFlow SDK for Node.js — ship HTTP logs to your TrustFlow threat detection dashboard with zero dependencies.

Installation

npm install trustflow-sdk

Quick Start

const { TrustFlow } = require('trustflow-sdk');

const tp = new TrustFlow({
  apiKey: process.env.TRUSTFLOW_API_KEY,
  endpoint: 'https://your-trustflow-instance.com',
});

// Track an event manually
tp.track({
  timestamp: new Date().toISOString(),
  user: '[email protected]',
  ip: '203.0.113.42',
  action: 'POST',
  status: 'success',
  resource: '/api/login',
});

// Before process exit
await tp.shutdown();

Express Middleware

Automatically capture every HTTP request/response:

const express = require('express');
const { trustFlowMiddleware } = require('trustflow-sdk/express');

const app = express();

app.use(trustFlowMiddleware({
  apiKey: process.env.TRUSTFLOW_API_KEY,
  endpoint: 'https://your-trustflow-instance.com',
}));

app.get('/', (req, res) => res.send('OK'));
app.listen(3000);

The middleware automatically captures:

  • Timestamp — request time (ISO 8601)
  • User — from req.user.email, req.user.id, or 'anonymous'
  • IP — from X-Forwarded-For header or req.ip
  • Action — HTTP method (GET, POST, etc.)
  • Status'success' (2xx/3xx) or 'failure' (4xx/5xx)
  • Resource — request path (req.originalUrl)

How It Works

  1. Events are queued in memory
  2. When the queue reaches batchSize (default 25), events are flushed automatically
  3. A periodic timer also flushes every flushInterval ms (default 5000)
  4. Events are POSTed to POST /api/v1/ingest with your API key
  5. On network failure, events are re-queued for the next flush attempt

Configuration

| Option | Env Variable | Default | Description | |---|---|---|---| | apiKey | TRUSTFLOW_API_KEY | '' | Your TrustFlow API key | | endpoint | TRUSTFLOW_ENDPOINT | http://localhost:8000 | TrustFlow API base URL | | batchSize | — | 25 | Auto-flush after N queued events | | flushInterval | — | 5000 | Periodic flush interval (ms) |

API

new TrustFlow(options)

Create a new client instance.

tp.track(event)

Add an event object to the queue. Auto-flushes at batchSize.

tp.flush()

Manually flush all queued events. Returns a Promise.

tp.shutdown()

Stop the auto-flush timer and flush remaining events. Call before process exit.

Requirements

  • Node.js 18+ (uses native fetch)
  • Zero dependencies

License

MIT