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

@elliemae/feature-toggle-library

v26.3.0

Published

EllieMae Encompass Web Feature Toggles

Readme

@elliemae/feature-toggle-library

A TypeScript library for managing feature toggles across Encompass Web applications and environments.

EllieMae Encompass Web Feature Toggles

Installation

pnpm add @elliemae/feature-toggle-library

Usage

import {
  isFeatureEnabled,
  FEATURES,
  ENVS,
} from '@elliemae/feature-toggle-library';

// Check if a feature is enabled (uses window.__env.domain automatically)
if (isFeatureEnabled(FEATURES.E_CONSENT)) {
  console.log('E-Consent is enabled');
}

// Check for a specific environment
if (isFeatureEnabled(FEATURES.E_CONSENT, ENVS.QA)) {
  console.log('E-Consent is enabled in QA');
}

// Using string literals (case-insensitive)
if (isFeatureEnabled('e_consent', 'prod')) {
  console.log('E-Consent is enabled in PROD');
}

API

isFeatureEnabled(feature, env?)

Check if a feature is enabled for a given environment.

| Parameter | Type | Description | | --------- | -------- | ----------------------------------------------------------------------------- | | feature | string | Feature name (case-insensitive) | | env | string | Optional. Environment to check. Defaults to window.__env.domain or 'PROD' |

Returns: boolean - true if enabled, false if disabled

FEATURES

Object containing all available feature toggle names as constants.

FEATURES.E_CONSENT; // 'E_CONSENT'
FEATURES.ZZ_TEST_FT_1; // 'ZZ_TEST_FT_1'

ENVS

Object containing all available environment names as constants.

ENVS.PROD; // 'PROD'
ENVS.QA; // 'QA'
ENVS.LOCALHOST; // 'LOCALHOST'

UNDEFINED_FEATURE

Error message thrown when undefined is passed to isFeatureEnabled().

How It Works

  1. Source of truth: data/feature-toggles.csv contains all feature toggles and their environment states
  2. Build time: pnpm generate converts CSV → JSON (lib/generated/feature-toggles.json)
  3. Runtime: isFeatureEnabled() reads the generated JSON to check feature states

The "Negative Storage" Pattern

Features are stored with a "NO means enabled" pattern:

  • If METADATA[FEATURE][ENV] is true → feature is DISABLED
  • If METADATA[FEATURE][ENV] is false or missing → feature is ENABLED

This matches the legacy @elliemae/encw-feature-toggles behavior.

Development

Setup

pnpm install

Commands

| Command | Description | | --------------- | ---------------------------------------- | | pnpm generate | Generate JSON from CSV | | pnpm test | Run tests (auto-runs generate first) | | pnpm build | Build library (auto-runs generate first) | | pnpm lint | Lint code |

Adding/Updating Feature Toggles

  1. Edit data/feature-toggles.xlsx
  2. Export to data/feature-toggles.csv
  3. Run pnpm test to verify
  4. Commit and release

Migration from @elliemae/encw-feature-toggles

This library is a TypeScript rewrite of the legacy @elliemae/encw-feature-toggles package with:

  • ✅ Same API (isFeatureEnabled, FEATURES, ENVS)
  • ✅ Same behavior (negative storage pattern)
  • ✅ TypeScript support with full type definitions
  • ✅ Modern build outputs (ESM, CJS, UMD)

Drop-in replacement - just change the import:

- import { isFeatureEnabled, FEATURES } from '@elliemae/encw-feature-toggles';
+ import { isFeatureEnabled, FEATURES } from '@elliemae/feature-toggle-library';

.