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

@datadog/flagging-core

v3.4.0

Published

Runtime-agnostic flag-evaluation logic for Datadog Flagging

Readme

Datadog OpenFeature Core Library

Configuration parsing entry points

The default @datadog/flagging-core entry point parses precomputed configuration without loading the protobuf decoder. To parse both precomputed and rules-based configuration, opt into the full parser:

import { configurationFromString, configurationToString } from '@datadog/flagging-core/rules-based'

The /rules-based entry point is available through both the package's exports map and a physical rules-based/package.json for resolvers that do not support package exports:

  • Modern resolvers use the existing modular CommonJS/ESM implementations.
  • Legacy resolvers use self-contained CommonJS/ESM compatibility bundles generated from the same source during yarn build / package preparation. These include the required protobuf code, so consumers do not have to resolve its /wire or /codegenv2 subpaths.
  • Both paths expose the same API and reuse the same TypeScript declarations. The default entry point stays modular and does not import the compatibility bundles or protobuf decoder.

The compatibility bundles increase the npm package size, but only applications using the legacy rules-based entry point include them in their application bundle. They retain dependency copyright/license notices and source maps, and are left unminified for the application bundler to optimize.

The packed-package smoke test covers Android and iOS bundles with Metro package exports both enabled and disabled, including legacy CommonJS and ESM resolution. It executes those bundles in Node without BigInt, TextEncoder, or TextDecoder; this checks fallback behavior but does not replace execution tests on an actual Hermes or JavaScriptCore runtime.

Preparing activation timestamps

Rules configurations are snapshots. The protobuf decoder prepares randomization activation timestamps once, and the Node provider prepares JSON configurations in setConfiguration. Invalid activation marks only the affected flag as a parse error, regardless of opt-out mode. Evaluation compares the prepared seconds and fractional seconds without reparsing the timestamp; using a JavaScript Date here would lose the nanosecond precision needed at the opt-out cutoff.

Direct JSON core consumers can call prepareUniversalFlagConfiguration(configuration) when receiving configuration. Existing low-level evaluation calls still accept raw configurations and prepare each flag once on first use. Replace changed flags instead of mutating prepared flags in place. Preparation does not change the serialized configuration.

Adding a public entry point

packages/core/package.json exports is the single source of truth for public paths. To add @datadog/flagging-core/foo:

  1. Create src/foo.ts with the intended exports. Keep any required initialization in this source entry point, rather than adding it to a bundler-specific list.

  2. Add its modern mapping to exports:

    {
      "./foo": {
        "types": "./cjs/foo.d.ts",
        "import": "./esm/foo.js",
        "require": "./cjs/foo.js",
        "default": "./esm/foo.js"
      }
    }
  3. Run yarn workspace @datadog/flagging-core build and commit the generated metadata with the source change. Add the feature's behavior tests as usual.

The build generates the physical fallback manifests, publish-file list, legacy declaration mappings, and compatibility-bundle side-effect entries. It discovers and builds a CJS/ESM compatibility bundle for every public JavaScript subpath automatically. Do not edit those fallback manifests or register new paths in the Webpack configuration or smoke fixtures.

Concrete nested subpaths are supported; wildcard exports and mismatched CJS/ESM/type targets fail with an actionable error. Removing a path from exports and rebuilding removes its owned fallback manifest and derived metadata without deleting unrelated files.

yarn check:entrypoints checks generated metadata without changing files. CI runs it before building, and prepack checks it before packing so a stale publish-file list cannot silently omit a new entry point. The packed-package tests discover every declared path and generate static imports for the full Metro matrix. The default entry point remains separate and light.

End-user license agreement

https://www.datadoghq.com/legal/eula