hindenburg

JSON document-based feature flag management

Usage no npm install needed!

<script type="module">
  import hindenburg from 'https://cdn.skypack.dev/hindenburg';
</script>

README

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.