Skip to content

elijahmanor/greeting-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

greeting-time

Get a greeting by the time of day

Install

$ npm install greeting-time

Usage

const greetingTime = require("greeting-time");

greetingTime(new Date()); // Good morning, Good afternoon, or Good evening

Notes

  • "Morning" is from 5am until noon
  • "Afternoon" is from noon until 5pm
  • "Evening" is from 5pm until 5am

I didn't include "Night" because "Good night" doesn't feel like a greeting. It conveys more of a farewell, which isn't the intent of the greeting-time module.

License

MIT © Elijah Manor