electoral-votes

0.0.32 • Public • Published

electoral-votes

A node.js module for retrieving a state's electoral votes for a given year.

Installation

npm install electoral-votes

Usage

const ev = require('electoral-votes');
ev();

Returns an array of objects for all states and all years.

API

.byYear(year)

year integer

const ev = require('electoral-votes');
ev.byYear(1788);

Returns a an array of objects representing each state with electoral votes for the year specified.

.states(state)

state string | array of strings

const ev = require('electoral-votes');
ev.byState(['Alabama', 'District of Columbia', 'New York']);

Returns an object or an array of objects for each state specified.

Package Sidebar

Install

npm i electoral-votes

Weekly Downloads

0

Version

0.0.32

License

GPL-3.0

Unpacked Size

112 kB

Total Files

6

Last publish

Collaborators

  • natebrock