fetch-the-parrot

NPM Badge Github Actions Badge Codecov Badge

Install

$ npm install fetch-the-parrot

Usage

getParrot

Returns the object for the queried parrot.

(name?: string, url?: string) => Promise<ParrotRecord | null>
index.js
import { getParrot } from 'fetch-the-parrot';

const parrot = await getParrot('Party Parrot');
Response
Loading...

getParrotGif

Returns the .gif path for the queried parrot.

(name?: string, path?: string, url?: string) => Promise<string | null>
index.js
import { getParrotGif } from 'fetch-the-parrot';

const parrotGif = await getParrotGif('Party Parrot');
Response
Loading...

getParrotsJSON

Returns a JSON list of all parrots.

(url?: string) => Promise<ParrotRecords>
index.js
import { getParrotsJSON } from 'fetch-the-parrot';

const json = await getParrotsJSON();
Response
Loading...

getParrotsYAML

Returns a YAML list of all parrots.

(url?: string) => Promise<string>
index.js
import { getParrotsYAML } from 'fetch-the-parrot';

const yaml = await getParrotsYAML();
Response
Loading...
interface ParrotRecord {
  name: string;
  gif?: string;
  hd?: string;
  tip?: string;
}

type ParrotRecords = ParrotRecord[];