Package Exports
- election-data
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (election-data) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
election-data
U.S. election data from the Federal Election Commission.
Currently only provides data from the 2012 U.S. presidential election.
Installation
npm install election-data
API
.candidates()
var ElectionData = require('election-data');
var Election = new ElectionData();
Election.candidates();
Returns a list of all candidates listed on at least one state ballot (i.e., no write-ins).
.states(state)
state
string | array
var ElectionData = require('election-data');
var Election = new ElectionData();
Election.states(['AL', 'CA', 'FL']);
Returns election data for the states specified (using the state's two letter postal code (e.g., AL, CA, FL, DC). state
may be a string if only one state is specified. If invoked without state
, returns data for all states.