Gennai Node is a modular library created to facilitate retrieving data from the Gennai API in a NodeJS enviroment utilizing promises.
With npm:
npm install gennai-node
Or using yarn:
yarn add gennai-node
Gennai Node is fully modularized, which means you can import only what you need, like so:
import { getDigimons } from 'gennai-node';
async () => {
const digimonList = await getDigimons();
}
Or, for some reason, you can import everything in at once:
import * as Gennai from 'gennai-node';
async () => {
const digimonList = await Gennai.getDigimons();
}
It's recommended to use only what you need, for better performance.
import { getDigimonById } from 'gennai-node';
const agumon = await getDigimonById(1);
const gabumon = await getDigimonById(2);
import { getDigimonByName } from 'gennai-node';
const patamon = await getDigimonByName('patamon');
const gatomon = await getDigimonByName('gatomon');
import { getDigimons } from 'gennai-node';
const digimonList = await getDigimons();
With filters:
import { getDigimons } from 'gennai-node';
const digimonList = await getDigimons({
offset: 1,
limit: 3,
order: 'desc',
orderBy: 'name'
});
For a full list of endpoints and structures check the official API documentation.