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

cloud-feature-toggles

v1.1.0

Published

Cloud based feature toggles

Readme

cloud-feature-toggles

Simple implementation of feature toggles that are powered by cloud services.

Features

This module encapsulates all calls to check if a certain feature toggle is enabled. Furthermore, developers can choose a specific cloud service that hosts the feature toggles. Currently the following cloud services are supported:

Options

Object to be passed into module instantiation:

  • aws - contains all configurations of cloud services under AWS
    • region - AWS region (e.g. ap-southeast-1)
    • s3 - use this if you want to use AWS S3 to host your feature toggles
      • bucket - name of S3 bucket that hosts your feature toggles
    • dynamoDB - use this if you want to use AWS DynamoDB to host your feature toggles
      • tableName - name of DynamoDB table that hosts your feature toggles

Feature toggle representation

JSON format that represents the feature toggle:

{
  "id": "MY_FEATURE_TOGGLE"
  "isEnabled": true
}

Note: For AWS S3 the attribute id is optional as the name of the file would be the name of the feature toggle i.e. MY_FEATURE_TOGGLE

Usage (AWS S3)

// instantiate module with options object
const cloudFeatureToggles = require('cloud-feature-toggles')({
  aws: {
    region: '<REGION>', // e.g. ap-southeast-1
    s3: {
      bucket: '<FEATURE_TOGGLES_BUCKET>'  // e.g. my-feature-toggles
    }
  }
});

Usage (AWS DynamoDB)

// instantiate module with options object
const cloudFeatureToggles = require('cloud-feature-toggles')({
  aws: {
    region: '<REGION>', // e.g. ap-southeast-1
    dynamoDB: {
      tableName: '<FEATURE_TOGGLES_TABLE_NAME>'  // e.g. my-feature-toggles
    }
  }
});

isEnabled(featureToggle)

Note: featureToggle is case sensitive

const main = async() => {
  // use isEnabled method to check if MY_FEATURE_TOGGLE is enabled
  // note the await keyword
  if (await cloudFeatureToggles.isEnabled('MY_FEATURE_TOGGLE')) {
    // continue with MY_FEATURE flow
  } else {
    // continue with normal flow
  }
}

main();

Notes

  • This module primarily uses aws-sdk to connect to S3
  • Hence, if this is used in AWS environment (i.e. Lambda or EC2), do make sure that an IAM role with the appropriate policies is attached (i.e. S3 read access)
  • If your application is in a non-AWS environment (e.g. Azure), it might be better to utilise Azure Blob Storage to host your feature toggles
    • Support for this feature will be COMING SOON