cats-js

1.0.2 • Public • Published

cats-js

Node.js module that provides an API wrapper for The Cat API.

NPM

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] 
      ]
   }
}

See docs/index.html for a detailed documentation!

Readme

Keywords

Package Sidebar

Install

npm i cats-js

Weekly Downloads

5

Version

1.0.2

License

GPL-3.0

Last publish

Collaborators

  • saalvage