gw2-chat-code
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

gw2-chat-code

Encode and decode guildwars2 chat codes, fork from gw2e-chat-codes

Install

npm install gw2-chat-code

Usage

import { encode, decode, overwrite } from 'gw2-chat-code';
 
// type IType = 'skill' | 'item' | 'skin' | 'trait' | 'map' | 'recipe' | 'outfit' | 'objective';
 
encode('skill', 5842)
// -> '[&BtIWAAA=]'
 
encode('item', {id: 46762, quantity: 10, skin: 5807, upgrades: [24554, 24615]})
// -> '[&AgGqtgDgrxYAAOpfAAAnYAAA]'
 
decode('[&BtIWAAA=]')
// -> {type: 'skin', id: 5842}
 
overwrite('[&Avr2LQEA]', { quantity: 10 })
// -> [&Agr2LQEA]

Tests

npm test

Readme

Keywords

none

Package Sidebar

Install

npm i gw2-chat-code

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • bluelovers