Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sefinek/random-animals

The best npm package that retrieves images of random animals such as cats, foxes, dogs, and more! ๐Ÿ˜ป๐ŸฆŠ๐Ÿ•
https://github.com/sefinek/random-animals

alpacas api birds cats dogs fishes foxes image images random random-images skiffy

Last synced: 27 days ago
JSON representation

The best npm package that retrieves images of random animals such as cats, foxes, dogs, and more! ๐Ÿ˜ป๐ŸฆŠ๐Ÿ•

Awesome Lists containing this project

README

        

Just a cat



ยป About this package ยซ

๐Ÿ˜ฝ ๐ŸฆŠ


This package for npm returns random images of animals (cats, dogs, foxes etc.) from the official API.



The number of downloads
Last commit
Issues




## ๐Ÿ“ฅ ยป Installation
```bash
npm install @sefinek/random-animals
```

## ๐Ÿˆ ยป Usage
### โ€ข Async/await example
```js
const random = require('@sefinek/random-animals');

(async () => {
const data = await random.cat();
console.log(data.message);
})();
```

### โ€ข Promise example
```js
const random = require('@sefinek/random-animals');

random.fox().then(data => console.log(data.message));
```

## ๐Ÿ˜ป ยป Available functions
| Name | Usage | Description |
|--------------------------------------------------------------------------------------------------------------------------------|-------------------------|-----------------------------------------------|
| [cat](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L4) | `.cat()` | Return random cats |
| [dog](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L9) | `.dog()` | Return random dogs |
| [fox](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L14) | `.fox()` | Return random foxes |
| [fish](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L19) | `.fish()` | Return random fishes |
| [alpaca](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L24) | `.alpaca()` | Return random alpacas |
| [bird](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L29) | `.bird()` | Return random bird |
| | | |
| [version](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L35) | `.version()` | Return version of this module |
| [apiVersion](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L39) | `.apiVersion()` | Return API version |
| [cdnVersion](https://github.com/sefinek24/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L44) | `.cdnVersion()` | Return [CDN](https://cdn.sefinek.net) version |

## ๐Ÿ“ƒ ยป Returned object
```json
{
"success": true,
"status": 200,
"info": { "category": "animals", "endpoint": "cat" },
"message": "https://cdn.sefinek.net/images/animals/cat/neva-masquerade-cats-1375033-min.jpg"
}
```

## ๐Ÿค ยป Help
If you encounter any issues or have questions, please open a new [Issue](https://github.com/sefinek24/random-animals/issues/new) on GitHub.

## โญ ยป Thank you
If you find this package useful, please consider giving it a star on [GitHub](https://github.com/sefinek24/random-animals) page.