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

flaglite

v0.1.3

Published

Simple, fast feature flags for JavaScript and TypeScript — includes CLI

Readme

FlagLite SDK

Simple, fast feature flags for JavaScript and TypeScript. Go from signup to evaluating your first flag in under 30 seconds.

Installation

npm install flaglite

Quick Start

Using Environment Variable (Recommended)

Set your API key in the environment:

export FLAGLITE_API_KEY=fl_env_xxxxx

Then use the simple import:

import flags from 'flaglite'

if (await flags.enabled('new-checkout')) {
  showNewCheckout()
}

Explicit Initialization

import { FeatureFlags } from 'flaglite'

const flags = new FeatureFlags('fl_env_xxxxx')

if (await flags.enabled('new-checkout')) {
  showNewCheckout()
}

With User ID (Percentage Rollouts)

For sticky percentage rollouts, pass a user ID:

if (await flags.enabled('new-checkout', { userId: user.id })) {
  showNewCheckout()
}

The same user always gets the same result for the same flag.

Browser Usage (CDN)

No build step required:

<script src="https://cdn.flaglite.dev/sdk.min.js"></script>
<script>
  const flags = new FlagLite('fl_env_xxxxx')

  flags.enabled('new-checkout').then(enabled => {
    if (enabled) {
      showNewCheckout()
    }
  })
</script>

Configuration

import { FeatureFlags } from 'flaglite'

const flags = new FeatureFlags({
  apiKey: 'fl_env_xxxxx',
  baseUrl: 'https://api.flaglite.dev/v1', // default
  cacheTtl: 30000, // 30 seconds (default)
  prefetch: true, // prefetch all flags on init (default)
  timeout: 5000, // request timeout in ms (default)
})

API

flags.enabled(key, options?)

Check if a feature flag is enabled.

  • key (string): The flag key (e.g., 'new-checkout')
  • options.userId (string, optional): User ID for sticky percentage rollouts
  • Returns: Promise<boolean> - true if enabled, false otherwise

Always returns false on error (fail closed).

flags.isEnabled(key, options?)

Alias for enabled().

flags.clearCache()

Clear the local flag cache.

flags.waitForInit()

Wait for the initial prefetch to complete.

How It Works

  1. Caching: Flags are cached locally for 30 seconds (configurable)
  2. Prefetching: All flags are fetched on init to reduce latency
  3. Fail Closed: Returns false on any error
  4. Sticky Bucketing: Same user always gets the same result using MurmurHash3

TypeScript

Full TypeScript support included:

import flags, { FeatureFlags, EvaluateOptions } from 'flaglite'

const options: EvaluateOptions = { userId: 'user-123' }
const enabled: boolean = await flags.enabled('new-checkout', options)

CI/CD

This package uses automated CI/CD:

  • CI: Runs on every push/PR - linting, type checking, tests across Node 18/20/22
  • Release: Tag with v* (e.g., git tag v1.0.0 && git push --tags) to publish to npm

Required repository secrets for releases:

  • NPM_TOKEN - npm automation token with publish access

License

MIT