Skip to content
/ animals Public

Animals is an API wrapper that can make customizable HTTP requests to the URL specified making it fully modular!

License

Notifications You must be signed in to change notification settings

connuh/animals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Animals - a fully modular API wrapper. 🐢

Animals is an API wrapper that can make customizable HTTP requests to the URL specified making it fully modular!

Version Node License

Integrating ✨

If you would like to integrate animals into your project, you have to import it.

import Animals from "https://deno.land/x/animals/mod.ts";

After you import the file, you can call functions like this:

Animals.getAnimals(); // [ ]
Animals.get(); // <string>

Documentation 📖

Functions:

getAnimals();
registerAnimal();
get();
request();

Usage:

/**
 * Animals.getAnimals() returns an Array containing every `name` of the animals
 * available for you to call `get()` on.
 */
Animals.getAnimals();
/**
 * Animal.registerAnimal() returns a Boolean if the animal was succesfully registered.
 *
 * Takes in 4 parameters `name, method, url, key` (all 4 must be set)
 * This registers an animal for you to call `get()` on later
 */
Animals.registerAnimal(name, method, url, key);
/**
 * Animal.get() returns a String if the animal was succesfully requsted.
 *
 * Takes in a singular `name` parameter, if not set, it will be randomised
 * for a list of valid options for `name`, call `getAnimals()`
 *
 * Throws an error if you provide an invalid name
 */
Animals.get();
/**
 * Don't use this.
 */
Animal.request();

If you would like more use case, please see example.ts


Contributions 🎉

All contributions are accepted, simply open an Issue / Pull request.

About

Animals is an API wrapper that can make customizable HTTP requests to the URL specified making it fully modular!

Resources

License

Stars

Watchers

Forks

Packages

No packages published