Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

booleanify

1.0.0 • Public • Published

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

Install

npm i booleanify

DownloadsWeekly Downloads

52

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar