https://github.com/sefinek/random-animals
The best npm package for fetching random animal images, 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: 3 months ago
JSON representation
The best npm package for fetching random animal images, such as cats, foxes, dogs, and more! ๐ป๐ฆ๐
- Host: GitHub
- URL: https://github.com/sefinek/random-animals
- Owner: sefinek
- License: mit
- Created: 2022-09-19T02:00:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T14:44:38.000Z (4 months ago)
- Last Synced: 2025-04-09T22:53:27.363Z (3 months ago)
- Topics: alpacas, api, birds, cats, dogs, fishes, foxes, image, images, random, random-images, skiffy
- Language: JavaScript
- Homepage: https://npmjs.com/package/@sefinek/random-animals
- Size: 198 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![]()
ยป About this package ยซ
๐ฝ ๐ฆ
This package for npm returns random images of animals (cats, dogs, foxes etc.) from the official API.
![]()
![]()
![]()
## ๐ฅ ยป 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/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L4) | `.cat()` | Return random cats |
| [dog](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L9) | `.dog()` | Return random dogs |
| [fox](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L14) | `.fox()` | Return random foxes |
| [fish](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L19) | `.fish()` | Return random fishes |
| [alpaca](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L24) | `.alpaca()` | Return random alpacas |
| [bird](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L29) | `.bird()` | Return random bird |
| | | |
| [version](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L35) | `.version()` | Return version of this module |
| [apiVersion](https://github.com/sefinek/random-animals/blob/6f0104fe82471644e89cbc52281ac73fa578a267/test/index.test.js#L39) | `.apiVersion()` | Return API 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/sefinek/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/sefinek/random-animals) page.