is-affirmative
Returns true if a value is an `affirmative` value (from the affirmative lib). Useful for CLI prompts.
Last updated 9 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-affirmative 
SYNC missed versions from official npm registry.

is-affirmative NPM version Build Status

Returns true if a value is an affirmative value (from the affirmative lib). Useful for CLI prompts.

Install

Install with npm:

$ npm i is-affirmative --save

Usage

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

Related projects

affirmative: Array of 'yes' words and phrases that express the user's agreement with a statement or… more | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb on January 19, 2016.

Current Tags

  • 0.1.0                                ...           latest (9 years ago)

1 Versions

  • 0.1.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE