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

enrich.sh

v0.0.2

Published

Send JSON, get Parquet. Zero-dependency SDK for Enrich.sh — the serverless data ingestion pipeline.

Readme

enrich.sh

┌─────────────────────────────────────────────────┐
│                                                 │
│  ███████╗███╗   ██╗██████╗ ██╗ ██████╗██╗  ██╗  │
│  ██╔════╝████╗  ██║██╔══██╗██║██╔════╝██║  ██║  │
│  █████╗  ██╔██╗ ██║██████╔╝██║██║     ███████║  │
│  ██╔══╝  ██║╚██╗██║██╔══██╗██║██║     ██╔══██║  │
│  ███████╗██║ ╚████║██║  ██║██║╚██████╗██║  ██║  │
│  ╚══════╝╚═╝  ╚═══╝╚═╝  ╚═╝╚═╝ ╚═════╝╚═╝  ╚═╝  │
│                                                 │
│     Serverless Data Ingestion Pipeline          │
│    Your events → Parquet on R2 → DuckDB         │
│                                                 │
└─────────────────────────────────────────────────┘

Official JavaScript SDK for Enrich.sh


Install

npm install enrich.sh

Works in Node.js 18+, browsers, and edge runtimes (Deno, Bun, Workers).

Quick Start

  ┌──────────┐    track()     ┌──────────┐    flush     ┌──────────┐
  │  Your    │ ─────────────► │  SDK     │ ──────────► │  Enrich  │
  │  App     │   (buffered)   │  Buffer  │  (batched)  │  API     │
  └──────────┘                └──────────┘             └────┬─────┘
                                                            │
                                                       ┌────▼─────┐
                                                       │ R2       │
                                                       │ Parquet  │
                                                       └────┬─────┘
                                                            │
                                                       ┌────▼─────┐
                                                       │ DuckDB   │
                                                       │ Query    │
                                                       └──────────┘

1 · Initialize

import { Enrich } from 'enrich.sh'

const enrich = new Enrich('sk_live_your_api_key')

// Create a stream
await enrich.createStream('clicks', { schema_mode: 'evolve' })

// Send events
enrich.track('clicks', { url: '/pricing', user_id: 'usr_42' })

// Query your data as Parquet
const urls = await enrich.query('clicks', { days: 7 })

API

new Enrich(apiKey, options?)

| Option | Default | Description | |-----------|---------------------|------------------------------| | baseUrl | https://enrich.sh | API endpoint (custom domain) |

Ingestion

// Buffer events — SDK batches and flushes automatically
enrich.track('clicks', { url: '/home', user_id: 'usr_42' })

// Send immediately (bypasses buffer)
await enrich.ingest('clicks', [
  { url: '/home', user_id: 'usr_42' },
  { url: '/pricing', user_id: 'usr_77' },
])

// Flush before tab close (survives page unload)
enrich.beacon()

// Force flush buffered events
await enrich.flush()

// Cleanup on shutdown
await enrich.destroy()

Streams

// List all streams
const streams = await enrich.listStreams()

// Create a stream
await enrich.createStream('purchases', {
  schema_mode: 'strict',
  fields: {
    amount: { type: 'float64' },
    currency: { type: 'string' },
  },
})

// Get stream details
const stream = await enrich.getStream('purchases')

// Update stream config
await enrich.updateStream('purchases', { schema_mode: 'evolve' })

// Delete a stream
await enrich.deleteStream('old-stream')

Query

// Get signed Parquet URLs → pass to DuckDB
const urls = await enrich.query('clicks', { days: 30 })
await conn.query(`SELECT * FROM read_parquet(${JSON.stringify(urls)})`)

// Get URLs + file metadata
const detailed = await enrich.queryDetailed('clicks', { days: 7 })
console.log(`${detailed.file_count} files, expires ${detailed.expires_at}`)

Monitoring

// Usage stats
const stats = await enrich.usage({ start: '2026-02-01' })

// Recent errors
const errs = await enrich.errors({ limit: 20 })

// Dead Letter Queue
const rejected = await enrich.dlq('purchases', { days: 7 })

// Schema change history
const changes = await enrich.schemaEvents('purchases')

// Available enrichment templates
const templates = await enrich.templates()

Connect

// Get S3 credentials for direct warehouse access
const creds = await enrich.connect()
// → { endpoint, bucket, access_key_id, secret_access_key, sql }

Examples

Browser — Clickstream

import { Enrich } from 'enrich.sh'

const enrich = new Enrich('sk_live_xxx')

document.addEventListener('click', (e) => {
  enrich.track('clicks', {
    tag: e.target.tagName,
    id: e.target.id,
    path: location.pathname,
  })
})

window.addEventListener('beforeunload', () => enrich.beacon())

Node.js — Express Middleware

import { Enrich } from 'enrich.sh'

const enrich = new Enrich('sk_live_xxx')

app.use((req, res, next) => {
  const start = Date.now()
  res.on('finish', () => {
    enrich.track('api_logs', {
      method: req.method,
      path: req.path,
      status: res.statusCode,
      duration_ms: Date.now() - start,
    })
  })
  next()
})

process.on('SIGTERM', () => enrich.destroy())

DuckDB — Analytics

import { Enrich } from 'enrich.sh'

const enrich = new Enrich('sk_live_xxx')
const urls = await enrich.query('clicks', { days: 30 })

const result = await conn.query(`
  SELECT path, COUNT(*) as hits
  FROM read_parquet(${JSON.stringify(urls)})
  GROUP BY path
  ORDER BY hits DESC
`)

Specs

| Spec | Value | |------|-------| | Package size | < 4 KB | | Dependencies | 0 | | Runtime | Node 18+, Browsers, Edge | | Transport | HTTPS | | Auth | Bearer token (sk_live_* / sk_test_*) | | Output format | Apache Parquet | | Max request size | 1 MB |


License

MIT — Enrich.sh