Skip to content

Anime Search

rizzzigit edited this page Mar 25, 2022 · 1 revision

NOTE: This may not be compatible with the previous versions of ECMAScript.

Searching anime and display each scores respectively

await client.anime.search('Naruto')
  .then((result) => {
    console.log('No.\tScore\tTitle')

    let no = 1
    for (const anime of result) {
      console.log(`${no}.\t${anime.score}\t${anime.title}`)

      no++
    }
  })

Searching anime scored at least 7, sort and display each scores respectively

await client.anime.search('Naruto', { minScore: 7, sortBy: 'score', sort: 'desc' })
  .then((result) => {
    console.log('No.\tScore\tTitle')

    let no = 1
    for (const anime of result) {
      console.log(`${no}.\t${anime.score}\t${anime.title}`)

      no++
    }
  })