https://github.com/thomask33/node-underlords
Dota Underlords share codes encoding & decoding in TypeScript
https://github.com/thomask33/node-underlords
board boardcode code dota dota-underlords dota2 share sharecode underlords valve
Last synced: 7 months ago
JSON representation
Dota Underlords share codes encoding & decoding in TypeScript
- Host: GitHub
- URL: https://github.com/thomask33/node-underlords
- Owner: ThomasK33
- License: mit
- Created: 2020-09-06T15:54:45.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-09T17:54:34.000Z (8 months ago)
- Last Synced: 2025-03-09T18:32:03.660Z (8 months ago)
- Topics: board, boardcode, code, dota, dota-underlords, dota2, share, sharecode, underlords, valve
- Language: TypeScript
- Homepage:
- Size: 1.94 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Node-Underlords


[](https://coveralls.io/github/ThomasK33/node-underlords?branch=master)


TypeScript / JavaScript library for Dota Underlords.
---
## Features
- Share code parsing
- Share code encoding
## Installation
This is a [Node.js](https://nodejs.org/) module available through the [NPM registry](https://www.npmjs.com/) and [GitHub Packages](https://github.com/features/packages).
Before installing, please download and install a Node.js version greater or equal to 10.0.
Installation of the module is done using the npm install command:
```bash
npm install underlords
```
## Quick Start
```javascript
import { ShareCodeV8 } from "underlords";
// Parse an Underlords share code to a ShareCodeV8 instance
const shareCodeString =
"8qAMAAP4BAK4BAATjJ/5uAEZuAAAgEVM0LgAAAG0AbQAACwAAAP8BDAABCRsI/wAJARcBAQAOAQUBAQAGES0QbUBHOlcBEmoBAAFIACABaBABAyAAEAEpLAIgIAAwAAAGAgEgAAWCAHUR2gB0EQkBAQRjAAVyLBAAAgABBAMGdycAdy4fAK4BAA==";
const shareCode = ShareCodeV8.fromBase64String(shareCodeString);
// Log board unit at index 0x0
console.log(shareCode.boardUnitIDs[0][0]);
// -> 32 (Abaddon)
// Log unit item at index 4x4
console.log(shareCode.unitItems[4][4].itemID);
// -> 10211 (maelstrom_rot1)
// Change unit at 0x0 to unit id 46 (Alchemist)
shareCode.boardUnitIDs[0][0] = 46;
const resultingShareCode = shareCode.toBase64String();
// -> 8qAMAAP4BAK4BAATjJ/5uAEZuAAAuEVMBCThtAG0AAAsAAAD/AABtAAEJGwj/AAkBFwEBAA4BBQEBBAYAASEcbQAAbUBHOlcBEmoBAAFIJCAgAAAAAQMgABABKTACICAAMAAABgIBIAAAARoAdRHaAHQRCQEBBGMABXIsEAACAAEEAwZ3JwB3Lh8ArgEA
```
For all available fields, visit the API Docs of the [current share code](https://thomask33.github.io/node-underlords/classes/sharecodev8.html).
For unit and items ids, visit the [Fortify Repo](https://github.com/Fortify-Labs/Fortify/tree/master/services/shared/src/assets).
## Docs & Community
- [API Docs](https://thomask33.github.io/node-underlords/)
- [Discord Server](https://discord.gg/u9qJxzQ) (I'm Grey#1214)
## Contributing
[Contributing Guide](https://github.com/ThomasK33/node-underlords/blob/master/CONTRIBUTING.md)
## License
[MIT](https://github.com/ThomasK33/node-underlords/blob/master/LICENSE)
## Disclaimer
This project is not affiliated with Valve Corporation.
Dota Underlords, Dota and Steam are registered trademarks of Valve Corporation.