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

@fonderie/risk

v0.3.11

Published

Generic signal → meaning → decision engine — assess an action (trial start, login, registration, promo) against weak signals and a tunable ruleset, and return a graded verdict with reasons. Decides, never enforces: the app owns every side effect.

Readme

@fonderie/risk

A generic signal → meaning → decision engine. Assess an action — a trial start, a login, a registration, a promo redemption — against weak signals and a tunable ruleset, and get back a graded verdict with reasons. What to do with a verdict is your application's call.

Decides, never enforces. The engine is pure and synchronous: it reads signals and returns a verdict. It never calls Stripe, sends an email, or cancels anything. Every side effect — deny, challenge, step-up MFA, revoke, alert — lives in your app, which has the context to do it right. This is what keeps the brick sound and reusable across subjects.

Status: experimental (0.x — API may move).

Use it

import { RiskEngine, DEFAULT_RULESETS } from '@fonderie/risk';
import { getMigrationsPath } from '@fonderie/risk/migrations';
// run getMigrationsPath()'s SQL with your store's migration runner first.

const risk = new RiskEngine(store, {
  rulesets: DEFAULT_RULESETS,          // ships a 'trial.start' ruleset; add your own
  pepper: process.env.RISK_PEPPER,     // required in production
});

const verdict = await risk.assess('trial.start', {
  actorId: user.id,
  identifiers: [                        // hashed by the engine — raw values never stored
    { kind: 'card', value: cardFingerprint },
    { kind: 'device', value: deviceId },
    { kind: 'ip', value: ip },
    { kind: 'email-domain', value: emailDomain },
  ],
  attributes: { accountAgeMinutes, disposableEmail },
});

// The app maps the verdict to an action — the engine never does.
if (verdict.tier === 'high')   return deny(verdict.reasons);
if (verdict.tier === 'medium') return challenge();
await risk.record(verdict.assessmentId, 'allowed');   // makes the identifiers "seen" next time

Rulesets are data

A ruleset binds a subject to weighted signals and tier thresholds — move weights without a deploy. Signals are reuse (identifier seen before), velocity (count in a window), or attr (a fact from the context). See the shipped TRIAL_START_RULESET.

What it stores

One risk_events table of hashed identifiers (sha256 + pepper — never raw), with short retention and a hard wall against the analytics pipeline. assess() writes provisional rows; record() promotes them to the real outcome; purgeExpired() (call on a timer) enforces retention.

Peer-depends on @fonderie/core and @fonderie/store; imports no other brick. See docs/RISK-BRICK-DESIGN.md for the full design.