Skip to content
This repository has been archived by the owner on Aug 6, 2019. It is now read-only.

Latest commit

 

History

History
60 lines (45 loc) · 1.36 KB

README.md

File metadata and controls

60 lines (45 loc) · 1.36 KB

MOVED TO NEW OPEN SOURCE COLLECTION MONOREPO https://github.com/owsas/opensource

get-generation

Travis

This module returns the generation of a person, given it's birth year

For example, if a person was born in 2000, it would say that he/she is from the Generation Z

Installation

npm i --save get-generation

Generations available

  • Traditionalist < 1946
  • Older Boomer < 1955
  • Younger Boomer < 1965
  • Generation X (older) < 1971
  • Generation X (younger) < 1981
  • Generation Y < 1996
  • Generation Z < 2011
  • Generation Alpha (now) // 2018

Usage

import { getGenerationByAge, getGenerationByYear, getAllGenerationsInfo } from "get-generation";

getGenerationByYear(1954) // Older Boomer
getGenerationByYear(2011) // Generation Alpha
getGenerationByAge(20) // Generation Z (as of 2018)

getAllGenerationsInfo();
/* returns
[{
    name: 'Traditionalist',
    range: {
      min: 0,
      max: 1954,
    },
  }, {
    name: 'Older Boomer',
    ....
  }
]
*/

Creator

Juan Camilo Guarín Peñaranda Cali, Colombia

License

MIT.

Bibliography