1.0.2 • Published 7 years ago

cats-js v1.0.2

Weekly downloads
9
License
GPL-3.0
Repository
github
Last release
7 years ago

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!

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago