genshin-manager
TypeScript icon, indicating that this package has built-in type declarations

1.3.9 • Public • Published

GenshinManager

npm version npm downloads

Overview

A Node.js Enka.network and Genshin Data wrapper for Genshin Impact

This is NOT the source code of Enka.Network or its API.

Description

  • User Data and Character Stats using EnkaNetwork.
  • All Characters and All Weapons Data. (Including More Advanced Info, such as Skill Attributes and Weapon Refinements.)
  • Cache Updater for the new update of Genshin Impact.
  • Easily instantiated using id

Installation

Node.js 18 or newer is required.

Install genshin-manager including genshin cache data.(download EN TextMap by default.)

npm install genshin-manager

You can specify which TextMap to download during installation.('ALL' can also be specified).

npm install genshin-manager --download-language="JP"

If you have already moved the cache to another folder, you can also install without downloading the cache.

npm install genshin-manager --nocache=true

About Genshin Cache Data

Genshin cache data is from Dimbreath/AnimeGameData.

This data contains data of characters, weapons, materials, and more structure information of Genshin Impact.

You can change your cache directory.

const { Client } = require('genshin-manager')

// Change the directory to store cache data.
// Default directory is node_modules/genshin-manager/cache.
const client = new Client({ assetCacheFolderPath: './cache' })
await client.deploy()

Updating

You can update your genshin cache data.

const { Client } = require('genshin-manager')

// showFetchCacheLog is true by default
const client = new Client({ showFetchCacheLog: true })
await client.deploy()

Also, you can activate auto cache updater.

const { Client } = require('genshin-manager')

// autoFetchLatestAssetsByCron is "0 0 0 * * 3" by default
// By default, it runs every Wednesday at 00:00:00
// downloadLanguages is All TextMap by default
const client = new Client({
  downloadLanguages: ['EN', 'JP'],
  autoFetchLatestAssetsByCron: '0 0 0 * * 3',
})
await client.deploy()

// deactivate
const client = new Client({ autoFetchLatestAssetsByCron: undefined })
await client.deploy()

Also Feature

Images can be cached.

const { Client } = require('genshin-manager')

// autoCacheImage is true by default
const client = new Client({ autoCacheImage: true })
await client.deploy()

Automatically fixes defects in TextMap & ExcelBinOutput when they occur.

const { Client } = require('genshin-manager')

// autoFixTextMap and autoFixExcelBin is true by default
// but, if autoFetchLatestAssetsByCron is undefined, it is forced to false.
const client = new Client({ autoFixTextMap: true, autoFixExcelBin: true })
await client.deploy()

How to use

Fetching Enka Data

EnkaManager#fetch

const { Client, EnkaManager } = require('genshin-manager')

// Loading cache
const client = new Client()
await client.deploy()

const enkaManager = new EnkaManager()

const enkaData = await enkaManager.fetchAll(800802278)
console.log(enkaData.uid)
console.log(enkaData.playerDetail)
console.log(enkaData.characterDetails)
console.log(enkaData.nextShowCaseDate)

Genshin Character from characterId

Character

const { Client, CharacterInfo } = require('genshin-manager')

// Loading cache
const client = new Client({ defaultLanguage: 'JP' })
await client.deploy()

const character = new CharacterInfo(10000002)
// print character name in language "jp"
console.log(character.name) // output: 神里綾華

Genshin Weapon from characterId

Weapon

const { Client, Weapon } = require('genshin-manager')

// Loading cache
const client = new Client({ defaultLanguage: 'JP' })
await client.deploy()

const weapon = new Weapon(13501)
// print weapon name in language "jp"
console.log(weapon.name) // output: 護摩の杖

You can see the examples, please check Examples

For more information, please check Documentation.

You can see the changelog here.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.9127latest

Version History

VersionDownloads (Last 7 Days)Published
1.3.9127
1.3.80
1.3.70
1.3.60
1.3.51
1.3.40
1.3.30
1.3.20
1.3.135
1.3.00
1.2.91
1.2.80
1.2.70
1.2.661
1.2.54
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.41
1.1.30
1.1.20
1.1.10
1.1.00
1.0.645
1.0.541
1.0.420
1.0.30
1.0.22
1.0.10
1.0.00
0.5.07
0.4.109
0.4.90
0.4.80
0.4.70
0.4.60
0.4.50
0.4.417
0.4.30
0.4.28
0.4.10
0.4.01
0.3.710
0.3.65
0.3.524
0.3.40
0.3.30
0.3.20
0.3.10
0.3.00
0.2.151
0.2.140
0.2.130
0.2.120
0.2.114
0.2.100
0.2.90
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.2.00
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.81
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i genshin-manager

Weekly Downloads

425

Version

1.3.9

License

MIT

Unpacked Size

1.4 MB

Total Files

138

Last publish

Collaborators

  • rollphes