Skip to content

MrNice/yo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet another Yo api wrapper

This one has been done in a pseudo-functional style. Returns promise objects which resolve to node.js http responses unless you give a callback function.

Installation

Standard npm installation:

$ npm install --save yo-api

Usage

yo-api has a do-what-I-mean style API in the vein of jsdom.

yoapi('api_key', 'username'[, link, callback])

var yoapi = require('yo-api');

yoapi('api_key', 'aulekin', 'https://google.com');

// Send a link
yoapi('api_key', 'aulekin', 'https://google.com');

// Get your subscriber count
yoapi.subs('api_key');

// yoapi arity 1 returns curried version. Functional constructor pattern.
var yo = yoapi('api_key');

yo('aulekin');
yo('all');
yo('aulekin', 'https://google.com');

Please note that the following does not work

yo.subs() // undefined is not a function

License

Creative Commons Attribution 4.0 International MIT

Acknowledgements

Superagent is awesome Bluebird is awesomer Ramda is definitely my favorite though.

About

JavaScript Yo API wrapper for browsers and node.js/io.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published