$ npm install is-affirmative
Returns true if a value is an
affirmative
value (from the affirmative lib). Useful for CLI prompts.
Install with npm:
$ npm i is-affirmative --save
var isAffirmative = require('is-affirmative');
isAffirmative('yes');
//=> true
isAffirmative('no');
//=> false
See the [affirmative][] library for all supported values.
Examples
Returns true
if the value is affirmative:
isAffirmative('yes');
isAffirmative('yeah');
isAffirmative('ok');
isAffirmative('okay');
isAffirmative('sure');
//=> true
Returns false if the value is not (anything but) an affirmative value:
isAffirmative('nope');
//=> false
affirmative: Array of 'yes' words and phrases that express the user's agreement with a statement or… more | homepage
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb on January 19, 2016.
© 2010 - cnpmjs.org x YWFE | Home | YWFE