Wondering what’s next for npm?Check out our public roadmap! »

    animality
    TypeScript icon, indicating that this package has built-in type declarations

    1.5.1 • Public • Published

    animality

    A simple API wrapper that generates images & facts of any animal

    Installation

    Use the package manager npm to install animality.

    $ npm i animality

    Require

    const animality = require('animality');

    Usage

    Animals:

    • cat
    • dog
    • bird
    • panda
    • redpanda
    • koala
    • fox
    • whale
    • kangaroo
    • bunny
    • lion
    • bear
    • frog
    • duck
    • penguin

    Get one or multiple animal images and facts

    const animality = require('animality');
    
    // Singular animal.
    const animal = 'cat';
    
    animality.getAsync(animal).then(console.log);
    /*
      Output:
      {
        name: 'cat',
        image: 'An image URL here',
        fact: 'A fact here'
      }
    */
    
    // Multiple animals can also be used.
    const animals = ['cat', 'dog', 'panda'];
    
    animality.getAsync(animals).then(console.log);
    /*
      Output:
      [
        {
          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'
        }
      ]
    */
    
    // A random animal type.
    const animal = 'random';
    
    animality.getAsync(animal).then(console.log);
    /*
      Output:
      {
        name: 'redpanda',
        image: 'An image URL here',
        fact: 'A fact here'
      }
    */

    Install

    npm i animality

    DownloadsWeekly Downloads

    106

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    5.23 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar