votifier-x
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

VotifierX

npm

A simple Votifier implementation in TypeScript. Including standalone server and client of Votifier v2 protocol.

Installation

npm install votifier-x

Usage

Server

import { VotifierServer } from 'votifier-x';

const server = new VotifierServer({
  port: 8192, // optional, default is 8192
  tokenPath: 'path/to/tokens.json', // optional, default is 'tokens.json'
});
server.start();

server.on('vote', (vote) => {
  console.log(`Received vote from ${vote.username} at ${vote.address}`);
});

Client

import { VotifierClient } from 'votifier-x';

const client = new VotifierClient({
  host: '0.0.0.0',
  port: 8192,
  token: 'your-token',
  serviceName: 'your-service-name',
});

await client.sendVote({
  username: 'username',
  address: 'address',
});

Acknowledgements

Readme

Keywords

Package Sidebar

Install

npm i votifier-x

Weekly Downloads

5

Version

0.1.1

License

MIT

Unpacked Size

58.8 kB

Total Files

9

Last publish

Collaborators

  • kaito02020424
  • tutinoko2048
  • okakajp25