npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@red6/ng-feature-flags

v0.3.2

Published

Feature Flag module for Angular

Readme

Build Status Maintainability Test Coverage npm version

@red6/ng-feature-flags

This library lets you manage features in the frontend using a semver notation. Inspired by angular-feature-toggle.

Installation

npm install @red6/ng-feature-flags --save

Configuration feature flags

@red6/ng-feature-flags uses a semver notation per feature and expects a configuration like this:

{
    feature1: "1.5.1",
    feature2: "0.5.6"
}

This configuration toggles features inside the code according to their version conditions.

//Example for "feature1" : "1.5.1"
//^1.0.0 - true
//~1.5.0 - true
//~1.6.0 - false
//^2 - false
//* - true

For more information regarding the semver notation head over to the semver and the node-semver sites.

Getting Started

After installing, include NgFeatureFlagsModule in your application module like:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { NgFeatureFlagsModule } from '@red6/ng-feature-flags';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    NgFeatureFlagsModule.forRoot({feature1: "1.5.1", feature2: "0.5.6"}),
    BrowserModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Toggle features using a directive

There are two directives you can use in order to toggle features: show-if-feature and hide-if-feature.
Basically they act as ng-if and the opposite of ng-if. They add/remove elements from the DOM if a feature is enabled or satisfies a certain version.

<!-- will  be shown if the admin feature is enabled -->
<div *showIfFeature="'admin'">
    This is the admin panel
</div>
<!-- will not be shown if the widget feature is enabled -->
<div *hideIfFeature="'widgets'">
    Widgets coming soon...
</div>

With a specific version:

<!-- will be shown if the admin feature exists and satisfies the version ^1 -->
<div *showIfFeature="admin ^1">
    This is the admin panel
</div>
<!-- will be shown if the admin feature exists and satisfies the version ~2.0.1 -->
<div *showIfFeature="admin ~2.0.1">
    This is the NEW and improved admin panel
</div>

Update features

To update features you can use the update methode on the service:

@Component({ ... })
class AppComponent {
  constructor(private featureFlagsService: FeatureFlagsService) {}

  updateFeature() {
    this.featureFlagsService.updateFeatures({ feature1: "2.0.0" });
  }
}