yesnowtf

0.4.0 • Public • Published

Build Status npm version

node-yesnowtf

A yesno.wtf API library for Node.js.

Installation

npm install -g yesnowtf

Module Usage

This module provides the option to use promises instead of callbacks.

var yesnowtf = require('yesnowtf');
// undefined, yes, no, maybe
var decision;
 
// make a decision
yesnowtf.decide(decision)
  .then(function (data) {
    console.log(data);
  })
  .catch(function (err) {
    console.error(err.message);
  });
  
yesnowtf.decide(decision, function (err, data) {
  if (err) {
    console.error(err.message);
    return;
  }
 
  console.log(data);
});
{ answer: 'maybe',
  forced: false,
  image: 'http://yesno.wtf/assets/maybe/2-adc5f184452e691c3484d4266776ed3d.gif' }

Dependencies (1)

Dev Dependencies (5)

Package Sidebar

Install

npm i yesnowtf

Weekly Downloads

2

Version

0.4.0

License

MIT

Last publish

Collaborators

  • troutowicz