JSPM

feature-flag-core

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8
  • Score
    100M100P100Q33744F
  • License ISC

๐Ÿ Turn features on and off like a pro โ€“ no magic spells required.๐ŸŽฉโœจ

Package Exports

  • feature-flag-core
  • feature-flag-core/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (feature-flag-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐Ÿ Feature Flag Core NPM version NPM downloads

Managing features in your app is like juggling flaming swords. One wrong move, and itโ€™s chaos. But with Feature Flag Core, you can tame those swords and keep everything in control without burning yourself out. ๐Ÿ”ฅ This manager really does the heavy lifting. THIS Manager ;)


๐Ÿค– What is Feature Flag Core?

Glad you asked! Itโ€™s the superhero of feature flags โ€“ think of it as the Swiss Army Knife for all your flag needs. You get a slick UI to toggle features, a local backend to keep things in check, and a hook to easily consume your flags in your app. Oh, and did we mention you can do all of this without breaking a sweat? ๐Ÿ˜Ž

๐Ÿ›  Features (AKA, Whatโ€™s In It for You?)

  • UI for Flag Management: See all your flags in one place. Toggle them on, off, or somewhere in between (just like your mood on a Monday).
  • Local Backend: Running your own local backend so youโ€™re not at the mercy of some third-party service. Control is ๐Ÿ”‘.
  • Easy Setup: Just a couple of imports and boom โ€“ youโ€™re in business.
  • Port Customization: You can set it to any port (because we know you like options). Donโ€™t let the port dictate your life. ๐Ÿ‘Š

๐Ÿง‘โ€๐Ÿ’ป How to Use It (AKA, Get It Up and Running in T-30 seconds or Less)

1. Set Up the Feature Flag Core UI

First, install the module and add the UI:

npm install feature-flag-core

Now import the magic:

import { FeatureFlagManager } from 'feature-flag-core'
import "feature-flag-core/dist/src/ui/toggleStyles.css"

Then, just place it in your app like this:

<FeatureFlagManager />

Demo

Feature Flag Core Demo

๐ŸŽ› Optional Props:

  • customUrl: Want to use a custom backend URL? Go wild. (This will override the port.)
  • port: Specify the port for the backend. (Defaults to 3231 because we like symmetry.)

2. Use Flags in Your App (AKA, How to Stop Thinking and Let the Code Do the Work)

Now that the UI is up and running, consuming flags is as easy as ordering pizza ๐Ÿ•:

import { useFlagFromApi } from 'feature-flag-core'

const flagValue = useFlagFromApi("your-flag-name")

This will give you a true or false value based on the flagโ€™s state. Itโ€™s like flipping a switch, but without the annoying light flicker.


3. Start Your Local Backend (AKA, The Magic That Makes It All Happen)

You need a backend to manage those flags. Fire it up with:

npx feature-flag-cli

Or if youโ€™re feeling fancy and need a custom port:

npx feature-flag-cli --port <yourPortNumber>

By default, it runs on port 3231 because, well, weโ€™re into simplicity. But hey, you do you.


Feature Flag Core is here to save your life (or at least your production environment). It gives you the power to turn features on or off without a commit, without a deploy, and without begging for forgiveness later. ๐Ÿ™Œ


๐Ÿค– Why Should You Care?

Letโ€™s be real. You donโ€™t want to deploy every single time you want to turn a feature on or off. With Feature Flag Core, you can:

  • Control: The flags are in your hands. No more guessing.
  • Test: Gradually roll out new features to specific users. Itโ€™s like A/B testing without the messy spreadsheets.
  • React Fast: Features can be switched off at a momentโ€™s notice, so if something goes wrong, you can recover faster than a cat falling off a counter.
  • Flexibility: Run it locally, customize it, and make it work how you want.

๐Ÿงฉ Use Cases (AKA, When Youโ€™ll Actually Need This)

  1. Feature Testing: Want to test that shiny new feature? Turn it on for a few users before rolling it out to everyone. Baby steps, people.
  2. A/B Testing: Because who doesnโ€™t love seeing what works best? Split users into groups and compare.
  3. Emergency Killswitch: Featureโ€™s broken? Hit the kill switch (no questions asked).
  4. Gradual Rollouts: Want to release a feature to 5% of your users? Now you can! Because being subtle is in.

๐Ÿง‘โ€๐Ÿ’ป Author (AKA, The Flag Whisperer)

This whole thing was crafted by cinfinit, a developer who got tired of feature flags being more like feature landmines (one wrong step and boom โ€“ chaos). Iโ€™m here to make your life easier, one toggle at a time.

When Iโ€™m not building tools that save you from feature flag Armageddon, Iโ€™m probably either:

Explaining to my laptop that we can get through this together โ˜•

Contemplating lifeโ€™s biggest mysteries, like โ€œWhy does npm start always seem to take longer than npm install?โ€ Well, it's because someone might have messed up the bundle. Someone , I didnt said me .

Or pretending to be productive while watching "how to make better dev tools" videos (we all do it).

Feel free to hit me up with feature requests, bug reports, or if you just want to share your latest meme discovery. I'm always game for a good laugh... or just another talk.

๐ŸŽ‰ And Thatโ€™s It! Youโ€™re Ready to Manage Feature Flags Like a Pro!