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

@customyai/flags-eval

v0.2.0

Published

Pure local feature flag evaluation engine for Customy FME.

Readme

@customyai/flags-eval

Pure feature-flag evaluation engine used by the Customy SDKs: treatments, targeting rules, segments, percentage rollouts with deterministic bucketing and prerequisites. No network, no I/O — give it a flag definition and a context, get a treatment.

npm install @customyai/flags-eval
import { evaluate } from "@customyai/flags-eval";

const detail = evaluate(flag, { key: "user-123", attributes: { plan: "pro" } });
detail.treatment; // "on"

Most apps do not use this package directly: @customyai/customy-access/flags loads the published snapshot of an environment, evaluates locally with this engine and reports exposures.

Bucketing is MurmurHash3 (32-bit) over namespace:key, so the same key always lands in the same bucket in every runtime.

Evaluation contract

evaluate() returns an EvaluationDetail:

| Field | Meaning | |---|---| | treatment, value, config | Served treatment, its value and its optional per-treatment config (also on rollouts and on the default). | | reasonCode | Contract reason: default, off (archived), killed, prerequisite_failed, rule:<id>, segment:<key> (a rule whose condition is a bare segment), rollout, error. | | reason | Legacy spelling, unchanged for existing consumers: default, killed, archived, prerequisite_failed, rule_match, rollout, error. See LEGACY_REASON_ALIASES. | | bucketBp | Stable bucket 0..9999 = floor(murmur3_32("<flagKey>:<salt>:<contextKey>") / 2^32 * 10000). bucket (0..99) is floor(bucketBp / 100). |

Rules: the salt is rollout.salt ?? flag.salt ?? ""; raising a rollout percentage never moves a unit already inside it; changing the salt reshuffles everyone. regex patterns longer than 512 characters or invalid evaluate to error (default treatment). A missing numeric attribute never satisfies gt/gte/lt/lte. createDependencies() resolves prerequisites over a whole snapshot; a cycle, an unknown flag or a chain deeper than 10 counts as not met (prerequisite_failed). The shared parity vectors live in packages/customy-access-php/tests/fixtures/flags-parity.json and every SDK must reproduce them.