cats-js
v1.0.2
Published
Wrapper for The Cat API
Downloads
13
Readme
cats-js
Node.js module that provides an API wrapper for The Cat API.
Features
- Get random cats
- Save & load cats you like
- 100% promise based
- JSON Output
- And more!
Simple Example
var cats = require("cats-js");
var c = new cats();
c.get().then((cat) => {console.log(cat)});
Output
{ images:
{ image:
{ url: 'http://24.media.tumblr.com/tumblr_m34d23c4x21qhwmnpo1_500.jpg',
id: '42p',
source_url: 'http://thecatapi.com/?id=42p'
}
}
}
More complex example
var cats = require("cats-js");
var c = new cats();
c.get({results_per_page: 10, type: "gif"}).then((cats) => {console.log(cats)});
Output
{ images:
{ image:
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object]
]
}
}