1.1.3 • Published 10 months ago

@seobryn/local-flags v1.1.3

Weekly downloads
-
License
AGPL-3.0-only
Repository
github
Last release
10 months ago

Local Flags

This tool helps you to manage feature flags locally in the browser. It use vanilla javascript to manage feature flags, so you can use it in any web application.

Install

# Using npm
npm install @seobryn/local-flags

# Using pnpm
pnpm i @seobryn/local-flags

or if you want to add it through the CDN:

import { setupLocalFlags } from "https://cdn.jsdelivr.net/npm/@seobryn/local-flags@latest/index.mjs"
import { setupLocalFlags } from "https://unpkg.com/@seobryn/local-flags@1.0.9/index.mjs"

Usage

// in your main js file
import { setupLocalFlags } from '@seobryn/local-flags';

setupLocalFlags(); // use this to setup local flags.

setupLocalFlags({
    calendarView: false
}); // use this to setup local flags with default values.

const localFlags = setupLocalFlags({
    calendarView: false
}, { useGloblal:false }) // use this setup if you want to expose localFlags Object in your JS code without using the global variable.
// in your application or in the browser console
localFlags.enableFeature('calendarView'); // use this to enable a feature.
localFlags.disableFeature('calendarView'); // use this to disable a feature.
localFlags.featureList(); // use this to list all features.
localFlags.isFeatureEnabled('calendarView'); // use this to check if a feature is enabled.

Live example

Try out the live example here

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago