https://github.com/leflon/tetrio.js
A promise-based module to interact with the TETR.IO API
https://github.com/leflon/tetrio.js
api module node tetrio typescript
Last synced: 3 months ago
JSON representation
A promise-based module to interact with the TETR.IO API
- Host: GitHub
- URL: https://github.com/leflon/tetrio.js
- Owner: leflon
- Created: 2020-12-09T21:07:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T21:07:14.000Z (over 3 years ago)
- Last Synced: 2025-03-18T14:53:58.767Z (3 months ago)
- Topics: api, module, node, tetrio, typescript
- Language: TypeScript
- Homepage: https://hicka.dev/tetrio.js
- Size: 179 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# tetrio.js
## A promise-based module to interact with the TETR.IO API### Installation
Install tetrio.js with npm:
```
npm install tetrio.js
```
As TETR.IO is in alpha, the API may change without notice and this module may as well change or be nonfunctional.
### Documentation
Not-so-good-looking documentation can be found [here](https://hicka.dev/tetrio.js/).I recommend using [Visual Studio Code](https://code.visualstudio.com) to develop with tetrio.js. Built-in intellisense will give you useful informations and will prevent wrong uses.
You can also check [the official documentation](https://tetr.io/about/api), but this module is not modeled on it.
#### Example use
```js
const tetrio = require('tetrio.js');
const client = new tetrio.Client();client.getUser('hicka').then(user => {
console.log(user);
});
/* Data:
id: '5e8cc73320d4e90291432ba8',
name: 'hicka',
supporter: false,
verified: false,
role: 'user',
bot: false,
country: 'FR',
flag: '🇫🇷' ,
league: {
apm: 35.5,
decaying: false,
gamesPlayed: 532,
gamesWon: 267,
glicko: 1882,
percentile: 0.13706227222310252,
percentileRank: 's+',
rank: 's+',
rating: 20283.25003409502,
rd: 61,
standing: 1731,
localStanding: 32,
pps: 1.84,
vs: 74.09,
winRate: 0.5018796992481203
},
avatarUrl: 'https://tetr.io/user-content/avatars/5e8cc73320d4e90291432ba8.jpg?rv=1601327878791',
badges: Map {},
badStanding: false,
gamesPlayed: 606,
gameTime: 199243.65106111096,
gamesWon: 304,
winRate: 0.5016501650165016,
xp: 794948
*/
```### Author
**tetrio.js, by Hicka**[](https://github.com/hickatheworld)