a lightweight meek stv javascript library
based on caritat
import Election and Ballot from the package
import { Election, Ballot } from "meek-stv";
create a new election with the available options and your candidates
const candidates = ["Epic", "Cool", "Nice", "Great"];
const election = new Election({ candidates });
add the ballots to the election
election.addBallot(new Ballot(["Cool", "Epic", "Great", "Nice"], 29));
election.addBallot(new Ballot(["Epic", "Cool", "Great", "Nice"], 13));
election.addBallot(new Ballot(["Great", "Epic", "Cool", "Nice"], 38));
election.addBallot(new Ballot(["Nice", "Epic", "Cool", "Great"], 15));
run the election with the amount of seats you want elected and get the results
const results = election.run(1);