Class Client

Constructors

  • Instantiate new Jikan client

    Parameters

    Returns Client

     const Jikan = require('jikan4.js')
    const client = new Client()

    console.log(await client.anime.get(5))

Properties

Anime resource context.

const anime = await client.anime.get(5)
const episodes = await anime.getEpisodes()

console.log(anime, episodes)
characters: CharacterManager

Characters resource context.

const character = await client.characters.get(1)
const voiceActors = await character.getVoiceActors()

console.log(character, voiceActors)

Clubs resource context.

const club = await client.clubs.get(<id>)

console.log(club.mmeberCount)
genres: GenreManager

Genres resource context.

const genres = await client.genres.list()

console.log(genres)
heartbeat: HeartBeatMonitor

Check if MAL is down.

const heartbeat = await client.heartbeat.check()

if (heartbeat.down)
console.warn('MAL is down!')
magazines: MagazineManager

Magazines resource context.

const magazines = await client.magazines.list()

console.log(magazines)

Manga resource context.

const manga = await client.manga.get(4)
const characters = await manga.getCharacters()

console.log(manga, characters)
off: (<K>(event: K, listener: ((...args: ClientEvents[K]) => void | Promise<void>)) => undefined)

Remove a listener.

client.off('debug', console.log)
on: (<K>(event: K, listener: ((...args: ClientEvents[K]) => void | Promise<void>), once?: boolean) => undefined)

Listen to client events.

client.on('debug', console.log)
once: (<K>(event: K, listener: ((...args: ClientEvents[K]) => void | Promise<void>), once?: boolean) => undefined)

Listen to client events once.

client.once('debug', console.log)
options: ClientOptions

Current options of the client.

You can change client options anytime.

People resource context.

const person = await client.people.get(<id>)
const pictures = await person.getPictures()

console.log(`${person.name}`, pictures)
producers: ProducerManager

Producers resource context.

const producers = await client.producers.list()

console.log(producers)
recommendations: RecommendationManager
reviews: ReviewManager
schedules: ScheduleManager
seasons: SeasonManager

Seasons resource context.

const seasons = await client.seasons.list()

console.log(seasons)