booleanify

Convert a value to a boolean - recognizes 'true' and 'false' strings

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
booleanify
301.0.09 years ago9 years agoMinified + gzip package size for booleanify in KB

Readme

booleanify Build Status
Convert a value to a boolean - recognizes 'true' and 'false' strings

Install

$ npm install --save booleanify

Usage

var booleanify = require('booleanify');

booleanify('true');
//=> true

booleanify('false');
//=> false

booleanify(false);
//=> false

booleanify(0);
//=> false

booleanify('');
//=> false

booleanify(null);
//=> false

booleanify(123);
//=> true

booleanify('foobar');
//=> true

License

MIT © Arthur Verschaeve