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

featureops

v0.1.4

Published

Official JavaScript (Client & Node.js) Library for the Feature Ops Web API

Readme

Feature Ops - JavaScript (Client & Node.js) SDK

Official JavaScript (Client & Node.js) Library for the Feature Ops Web API

Features

  • Provide (and evaluate) feature flags settings to the client and/or the server
  • Capture and store feature flag statistics within Feature Ops

Support

The Feature Ops JavaScript Client SDK supports the following browsers:

  • Chrome
  • Internet Explorer (IE10+)
  • Firefox
  • Safari

Install

Client or Server

$ npm install featureops

import featureops from 'featureops';

(The client is compatible with Browserify or Webpack.)

Client

If you are not using a front-end build process, the client can also be installed via a script tag.

Production version:

<script src="https://app.featureops.com/featureops.min.js"></script>

Development version:

<script src="https://app.featureops.com/featureops.js"></script>

(If you are using the client without Browserify or Webpack, featureops will be accessible from the global.)

Quick Start

var options = {
    pollingInterval: 5 // number, in minutes, to refresh local feature flag cache, default is 5
};
var client = featureops('{ENVIRONMENT_AUTH_KEY}', options);

client.init().then(function () {
    var targets = [ /* Optional array of target strings to evaluate feature against */];

    client.evalFlag('{CODE_TOKEN}', targets).then(function (isOn) {
        if (isOn) {
            // Feature Is On
        }
        else {
            // Feature Is Off
        }
    })
    .catch(function (error) { /* Take Error Action */ });
})
.catch(function (error) { /* Take Error Action */ });

API

An instance of the Feature Ops client can be obtained by passing your environmentAuthKey along with an optional options object containing configuration properties. You should only create one client during the lifetime of your applicaiton.

var client = featureops(environmentAuthKey, options);

environmentAuthKey: Your private environment key string accessed, from within the Feature Ops application, by selecting the environment for which you choose to target.

options: An optional object of properties that are used to configure the Feature Ops client.

|Key|Type|Value| |---|---|---| |pollingInterval|number|The amount of time, in minutes, that the Feature Ops client should check for changes to its feature flags cache|

Client Methods

client.init()

Returns a Promise after the call is complete. This method call should be made on application load as it will fetch and locally cache feature flag settings for the environment that you are targeting. Upon success, you are free to make calls to evalFlag, as needed, to evaluate whether a feature is 'on' or 'off'.

client.init().then(function () {
    // Ready to go!
})
.catch(function (error) { /* Take Error/Fallback Action */ });

client.evalFlag(codeToken, targets)

Returns a Promise after the call is complete. This method call should be made when you need to determine if a feature, for a given user, is 'on' or 'off'.

codeToken: A string that defined when adding your feature to the Feature Ops application. This is the unique code identifier when accessing its feature flag settings.

targets: An array of strings, which pertain to the end user, that will be used to evaluate whether or not a feature flag should be 'on' or 'off'. These will only impact the feature flag evaluation if the feature flag setting, for the environment that you are targeting, is set to 'Targets On' otherwise the targets will simply be ignored.

client.evalFlag(codeToken, targets).then(function (isOn) {
    if (isOn) {
        // Feature Is On
    }
    else {
        // Feature Is Off
    }
})
.catch(function (error) { /* Take Error/Fallback Action */ });

License

MIT License