npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gonetone/hoyowiki-api

v1.3.1

Published

A unofficial Node.js library for HoYoWiki API, can get the details of Genshin Impact items!

Downloads

15

Readme

HoYoWiki API (Node.js Library)

English | 繁體中文 | 简体中文

A unofficial Node.js library for HoYoWiki API, can get the details of Genshin Impact items!

Report Issues

Please report any bugs you discover at https://github.com/GoneTone/node-hoyowiki-api/issues.

Installation

Node.js 14.0.0 or newer is required.

npm install @gonetone/hoyowiki-api

Example usage

Get a list of all data:

const {
  Character, // Character
  // Weapon, // Weapons
  // Artifact, // Artifacts
  // Enemy, // Enemies and Monsters
  // Material, // Teyvat's Resources
  // Npc, // NPC Archive
  // Animal, // Wildlife
  // Book, // Books
  // Tutorial, // Tutorial
  CharacterFilters, // Character Filters
  // WeaponFilters, // Weapons Filters
  // ArtifactFilters, // Artifacts Filters
  // EnemyFilters, // Enemies and Monsters Filters
  // MaterialFilters, // Teyvat's Resources Filters
  // NpcFilters, // NPC Archive Filters
  // AnimalFilters, // Wildlife Filters
  // TutorialFilters, // Tutorial Filters
  setLanguage,
  Language
} = require('@gonetone/hoyowiki-api')

setLanguage(Language.EnglishUS).then(async () => {
  const character = new Character() // Character
  // const weapon = new Weapon() // Weapons
  // const artifact = new Artifact() // Artifacts
  // const enemy = new Enemy() // Enemies and Monsters
  // const material = new Material() // Teyvat's Resources
  // const npc = new Npc() // NPC Archive
  // const animal = new Animal() // Wildlife
  // const book = new Book() // Books
  // const tutorial = new Tutorial() // Tutorial

  /* All Genshin Impact character data list */
  const result = await character.getList()
  console.log(result)

  /* All Genshin Impact character data list (Apply "Pyro, 5-Star" filters) */
  const result2 = await character.getList(CharacterFilters.ElementalType.Pyro, CharacterFilters.Quality.Star5)
  console.log(result2)

  /* Total number of data */
  const result3 = await character.getTotal()
  console.log(result3)

  /* Total number of data (Apply "Pyro, 5-Star" filters) */
  const result4 = await character.getTotal(CharacterFilters.ElementalType.Pyro, CharacterFilters.Quality.Star5)
  console.log(result4)

  /* Search list by character name */
  const result5 = await character.searchListByName('Yelan')
  console.log(result5)
})

Get specific item details:

const {
  Entry,
  setLanguage,
  Language
} = require('@gonetone/hoyowiki-api')

setLanguage(Language.EnglishUS).then(async () => {
  const entry = new Entry()

  const result = await entry.get(2252) // "2252" is the ID of the character "Yelan"
  console.log(result)

  const result2 = await entry.get(2254) // "2254" is the ID of the weapon "Aqua Simulacra"
  console.log(result2)

  const result3 = await entry.get(1319) // "1319" is the ID of the character level-up material "Runic Fang"
  console.log(result3)
})

Keyword search items:

const {
  Search,
  setLanguage,
  Language
} = require('@gonetone/hoyowiki-api')

setLanguage(Language.EnglishUS).then(async () => {
  const search = new Search()

  const result = await search.get('yel')
  console.log(result)
})

Change API language:

  • Language.EnglishUS - English
  • Language.ChineseTW - 繁體中文
  • Language.ChineseCN - 简体中文
  • Language.German - Deutsch
  • Language.SpanishES - Español
  • Language.French - Français
  • Language.Indonesia - Indonesia
  • Language.Japanese - 日本語
  • Language.Korean - 한국어
  • Language.Portuguese - Português
  • Language.Russian - Pусский
  • Language.Thai - ภาษาไทย
  • Language.Vietnamese - Tiếng Việt
const {
  Entry,
  setLanguage,
  Language
} = require('@gonetone/hoyowiki-api')

setLanguage(Language.Japanese).then(async () => {
  const entry = new Entry()

  const result = await entry.get(2252)
  console.log(result)
})

License

MIT