yepnope

1.1.0 • Public • Published

Yepnope

Build Status

Yepnope transforms yes/no answers into bools, very usefull for chatbots and command line tools.

Usage

require the lib using const yepnope = require('yepnoe')

  var ok = new yepnope('yes')
  //ok.true === true
 
 
  var notok = new yepnope('nope')
  //notok.false === true

Example

  function parseAnswer(text){
    var response = new yepnope(text);
 
    if(response.true){
      return 'thanks! i\'ll do that!';
    }
 
    if(response.false){
      return 'ups! i\'ll do something else then!';
    }
 
    if(!response.false && !response.true){
      return 'I don\'t understand!'
    }
 
  }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    11
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    11
  • 1.0.0
    3

Package Sidebar

Install

npm i yepnope

Weekly Downloads

5

Version

1.1.0

License

MIT

Last publish

Collaborators

  • entomb