hindenburg

1.3.1 • Public • Published

Hindenburg

This adds structure to a JSON-document based feature flag service. It's intended that the file created by this will live in a CDN with a short cache life & is requested by the frontend.

The CLI manipulates a JSON document on the file system.

Installation

npm install -g hindenburg

Add a config block to your package.json:

{
  ...
  "hindenburg": {
    "path": "feature-flags.json"
  }
  ...
}

If you don't supply this the default is a file in the current directory called feature-flags.json

Flag Management Usage

hb add-flag <flag>
hb remove-flag <flag>
hb set-default <flag> <default>
hb set-user <flag> <user> <'on'|'off'|'default'>
hb set-group <flag> <group> <'on'|'off'|'default'>

Package Usage

Install the module in the application you're going to use it in:

npm install hindenburg

Then construct a FlagObject:

import { initialise } from 'hindenburg

...

const flags = initialise({ ... json from fetching feature-flags.json ... })
const canWeasel = flags.canWeasel('can-weasel', { userId: 'me', group: undefined })

Fetching the json from feature-flags.json is left for the user to implement.

/hindenburg/

    Package Sidebar

    Install

    npm i hindenburg

    Weekly Downloads

    1

    Version

    1.3.1

    License

    ISC

    Unpacked Size

    37.2 kB

    Total Files

    29

    Last publish

    Collaborators

    • wombleton