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

@flaggr/evaluator

v0.3.0

Published

Standalone flag evaluator for Flaggr - zero dependencies, pure TypeScript

Readme

@flaggr/evaluator

npm License: MIT

Standalone flag evaluation engine for Flaggr. Zero dependencies, pure TypeScript.

Use this package for local/edge evaluation when you want to evaluate feature flags without making API calls. The evaluation rules are cached locally and evaluated in-process for sub-millisecond latency.

Installation

npm install @flaggr/evaluator

Usage

import { evaluateFlag } from '@flaggr/evaluator'

const result = evaluateFlag(
  {
    key: 'checkout-v2',
    type: 'boolean',
    enabled: true,
    defaultValue: false,
    targeting: [
      {
        id: 'enterprise-customers',
        conditions: [{ property: 'plan', operator: 'equals', value: 'enterprise' }],
        value: true,
      },
    ],
  },
  { targetingKey: 'user-123', plan: 'enterprise' },
)

console.log(result.value)  // true
console.log(result.reason) // "TARGETING_MATCH"

evaluateFlags(flags, context) evaluates a record of flags keyed by flag key, and Evaluator.evaluate(flag, context) is the same as evaluateFlag. Each result has a value, a reason and, when a variant was chosen, a variant.

Features

  • Zero dependencies
  • Gives the same results as Flaggr's data plane for the operators it implements: equals, not_equals, in, not_in, contains, starts_with, ends_with, greater_than, less_than, gte, lte, regex, before and after. isLocallyEvaluable(flag) tells you whether a flag uses only these. It also evaluates exists and not_exists. Cohort operators need the server.
  • Percentage rollouts with deterministic hashing
  • Targeting rules match as on the Flaggr data plane. A rule's condition groups, when it has them, decide (a group without conditions matches nobody); otherwise its conditions do, and a rule with no conditions matches everyone, so conditions: [] with rolloutPercentage: 10 serves the rule's value to 10% of all users. A context without a targetingKey is never in a rollout below 100%. Flaggr stores percentages and weights as whole numbers from 0 to 100. (Deployments of api.flaggr.dev from before Flaggr 0.5.0 match a rule with no conditions to nobody.)
  • Reads flags as the data plane encodes them (/api/flags/export, its SSE configuration events): a field encoded as null is unset, as is "" in conditionOperator, groupOperator and variant. So a rule whose rolloutPercentage is null serves everyone it matches, and one whose value is null serves the flag's default. An entry of targeting or overrides that isn't an object is skipped.
  • Variant splits by targeting key (a running Flaggr experiment assigns its variants only on the control plane, not here)
  • Type-safe evaluation (boolean, string, number, object)

Documentation