0.9.4 • Published 2 years ago

node-mindplays-api v0.9.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

node-mindplays-api

Mindplays.com API for NodeJS. Axios based library.

$ npm i node-mindplays-api

Basic usage

const { main } = require('../build/mindplays');
const { API_SECRET, GAME_ID } = process.env;
const sessionFabric = main(API_SECRET, GAME_ID);

go();
async function go() {

    const { user_id_1, user_id_2, room_id, battle_id, hash_1, hash_2 } = { /* .... */ };

    const player1 = await sessionFabric(user_id_1, room_id, battle_id, hash_1);
    const player2 = await sessionFabric(user_id_2, room_id, battle_id, hash_2);

    // ....

    player1.won(0.1, 'More points then player 2').from(player2);

    // ....

    player1.lost(0.2, 'Was not lucky :(').to(player1, 'Was lucky :)');

    player1.finishGame();
    player2.finishGame();
}

LICENCE

MIT.

0.9.4

2 years ago

0.6.7

2 years ago

0.9.3

2 years ago

0.7.5

2 years ago

0.6.8

2 years ago

0.8.1

2 years ago

0.7.2

2 years ago

0.6.3

2 years ago

0.7.1

2 years ago

0.6.2

2 years ago

0.9.2

2 years ago

0.7.4

2 years ago

0.6.5

2 years ago

0.9.1

2 years ago

0.7.3

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.5.1

2 years ago