Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

featureset

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

featureset

a painless feature toggle system in JavaScript

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

featureset

browser support Build Status

A painless feature toggle system in JavaScript. Decouple development and deployment.

Install

$ npm install --save featureset

Usage

var featureset = require('featureset');

// This will set the list of currently active
// features, and add the feature classes to the
// body element. It will take url parameters 
// into account:
var feature = featureset(['feature1', 'feature2']);

// Query for an active feature:
if ( feature.active('search') ) {
  // load the search code
}

features(features):Object

Take an optional list of features, set the feature classes on the body tag, and return the feature toggle object.

  • @param {Array} baseFeatures List of base features.
  • @return {Object} feature object Features passed into featureset()
var feature = featureset(['feature1', 'feature2']);

feature.active('feature1'); // true

.active(feature):Boolean

Check to see if a feature is active.

  • @param {String} feature
  • @return {Boolean}

.activate(features):Object (this)

Activate a list of features.

  • @emits activated
  • @param {Array} features
  • @return {Object} this (for chaining)

activated event.

  • @event activated
  • @type {Array} activated features

.deactivate(features):Object (this)

Deactivate a list of features.

  • @emits deactivated
  • @param {Array} features
  • @return {Object} this (for chaining)

deactivated event.

  • @event deactivated
  • @type {Array} deactivated features

License

MIT

Keywords

FAQs

Package last updated on 15 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc