enabled

WebJar for enabled

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

enabled
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

enabled
WebJar for enabled
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/3rd-Eden/enabled

Download enabled

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/enabled/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>enabled</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/enabled/
implementation 'org.webjars.npm:enabled:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/enabled/
implementation ("org.webjars.npm:enabled:2.0.0")
'org.webjars.npm:enabled:jar:2.0.0'
<dependency org="org.webjars.npm" name="enabled" rev="2.0.0">
  <artifact name="enabled" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='enabled', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "enabled" % "2.0.0"
[org.webjars.npm/enabled "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

enabled

Version npmBuild StatusDependenciesCoverage Status

Enabled is a small utility that can check if certain namespace are enabled by environment variables which are automatically transformed to regular expressions for matching.

Installation

The module is release in the public npm registry and can be used in browsers and servers as it uses plain ol ES3 to make the magic work.

npm install --save enabled

Usage

First of all make sure you've required the module using:

'use strict';

var enabled = require('enabled');

The returned enabled function accepts 2 arguments.

  1. name string, The namespace that should match.
  2. pattern string, The pattern that the name should satisfy

It will return a boolean indication of a match.

Examples

var flag = 'foo';

enabled('foo', flag); // true;
enabled('bar', flag); // false;

//
// Use * for wild cards.
//
var wildcard = 'foob*';

enabled('foobar', wildcard); // true;
enabled('barfoo', wildcard); // false;

//
// Use - to ignore.
//
var ignore = 'foobar,-shizzle,nizzle';

enabled('foobar', ignore); // true;
enabled('shizzle-my-nizzle', ignore); // false;
enabled('nizzle', ignore); // true;

License

MIT

Versions

Version
2.0.0
1.0.2