Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.
Install with npm:
$ npm install --save falsey
What is this?
This is intended to be a fun way of accepting alternatives to
false or "no" in CLI prompts, web forms, etc. For example, you might want to allow users to define
nope to disable something.
const falsey = ;console; //=> trueconsole; //=> trueconsole; //=> trueconsole; //=> trueconsole; //=> false
; //=> true; //=> true; //=> true; //=> true; //=> true; //=> true; //=> true; //=> true
If a value matches one of the built-in "falsey" keywords (all strings) it will return
Customize falsey keywords
Pass an array of custom keywords that should return
true when evaluated as falsey:
; //=> true
Disable built-in keywords by passing an empty array:
; //=> false
Extend built-in keywords
Built-in keywords are exposed on the
.keywords property so that you may extend them with your own keywords:
; //=> true
- objects will now always returns
- more words were added to the built-in list of falsey keywords
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
- is-number: Returns true if the value is a number. comprehensive tests. | homepage
- is-primitive: Returns
trueif the value is a primitive. | homepage
- isobject: Returns true if the value is an object and not an array or null. | homepage
- kind-of: Get the native type of a value. | homepage
This file was generated by verb-generate-readme, v0.6.0, on March 18, 2018.