Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

animality

Package Overview
Dependencies
6
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

index.d.ts

19

package.json
{
"name": "animality",
"version": "2.0.1",
"version": "2.0.2",
"description": "A simple API wrapper that generates images & facts of any animal",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"devDependencies": {
"@types/node": "^18.0.5",
"typescript": "^4.7.4"
"main": "index.js",
"dependencies": {
"node-fetch": "^3.3.2"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {

@@ -26,6 +28,3 @@ "type": "git",

},
"homepage": "https://animality.xyz",
"dependencies": {
"undici": "^5.7.0"
}
"homepage": "https://animality.xyz"
}
# animality-js
A simple API wrapper that generates images & facts of any animal
A simple package that generates images & facts of any animal using the Animality API.
# Installation
```bash
$ npm install animality
```
The Node.js wrapper for this API is available for use in [Node Package Manager](https://www.npmjs.com/package/animality). It's use is pretty straight-forward.
# Usage
These are the 17 animal strings that can be used to send a request to the API:
* `cat`
* `dog`
* `bird`
* `panda`
* `redpanda`
* `koala`
* `fox`
* `whale`
* `dolphin`
* `kangaroo`
* `bunny`
* `lion`
* `bear`
* `frog`
* `duck`
* `penguin`
* `axolotl`
# Example
```js
const {Animality} = require('animality');
const animal = 'cat';
Animality.getAsync(animal, 'API_KEY').then(console.log);
```
This outputs the following object in the terminal:
```json
{
"name": "cat",
"image": "An image URL here",
"fact": "A fact here"
}
```
Other than that, this package also allows you to request multiple animals at the same time.
```js
const {Animality} = require('animality');
const animals = ['cat', 'dog', 'panda'];
Animality.getAsync(animals, 'API_KEY').then(console.log);
```
This outputs the following array of objects in the terminal:
```json
[
{
"name": "cat",
"image": "An image URL here",
"fact": "A fact here"
},
{
"name": "dog",
"image": "An image URL here",
"fact": "A fact here"
},
{
"name": "panda",
"image": "An image URL here",
"fact": "A fact here"
}
]
```
# [Documentation](https://animality.xyz/packages#node-js)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc