An open API service indexing awesome lists of open source software.

https://github.com/jondotsoy/stron

Use the generics variables to transform a string to boolean.
https://github.com/jondotsoy/stron

Last synced: about 2 months ago
JSON representation

Use the generics variables to transform a string to boolean.

Awesome Lists containing this project

README

        

# stron

Use the generics variables to transform a string to boolean.

```javascript
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**

```javascript
const stron = require("stron");

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