Skip to content

JonDotsoy/stron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stron

Use the generics variables to transform a string to boolean.

const stron = require("stron");
const stroff = require("stroff");

stron("on"); // => true
stron("active"); // => true
stron("inactive"); // => false

stroff("off"); // => true
stroff("disable"); // => true
stroff("False"); // => true
stroff("enable"); // => false

Example

const stron = require("stron");

if (stron(process.env.FEATURENAME_ENABLED)) {
  installFeature();
}

About

Use the generics variables to transform a string to boolean.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published