nodetimeline

1.0.6 • Public • Published

Node Timeline

npm version downloads per month downloads all time

Node Timeline is a historically related node module full of random 21st century data that you may find useful. (2000 - Present)

Installation

This is a Node.js module available through the npm registry.

Before installing nodetimeline, download and install Node.js

Installation is accomplished using the npm install command:

$ npm i nodetimeline --save

Usage

First, of all make sure to include nodetimeline in your JavaScript File.

var t = require("nodetimeline");

Node Timeline is a very simple package to use. Every function has a year input, and returns either a string or number.

Functions

Politics (United States)

  • firstLady(year)
  • president(year)

let president = t.president(2005);
console.log(president);
 
// "George W. Bush"
 
// For a president's name between elections, add 0.1 or 0.2 to the election year
 
let president = t.president(2017.1);
console.log(president);
 
// "Barack Obama"
 
let president = t.president(2017.2);
console.log(president);
 
// "Donald Trump"
 
// Requesting a first lady's name also works the same way
 
let firstLady = t.firstLady(2018);
 
// "Melania Trump"

Sports

  • nbaChampion(year)
  • nflChampion(year)
  • nhlChampion(year)
  • mlbChampion(year)

let nbaChampion = t.nbaChampion(2017);
console.log(nbaChampion);
 
// "Golden State Warriors"
 
let nflChampion = t.nflChampion(2017);
console.log(nflChampion);
 
// "The New England Patriots"
 
let nhlChampion = t.nhlChampion(2017);
console.log(nhlChampion);
 
// "The Pittsburgh Penguins"
 
let mlbChampion = t.mlbChampion(2017);
console.log(mlbChampion);
 
// "The Houston Astros"

Package Sidebar

Install

npm i nodetimeline

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

7.82 kB

Total Files

4

Last publish

Collaborators

  • alexreedyt