Greet your Visitors with Good Morning, Good Afternoon or Good Evening Message using JavaScript
Install using npm
npm install greet-visitor
https://www.npmjs.com/package/greet-visitor
Sample Output - with emoji
Time Range | Output |
---|---|
>= 3 - <= 12 | π Good morning |
>= 12 - <= 17 | π Good afternoon |
>= 17 - <= 20 | π Good evening |
>= 20 - <= 24 | π Good night |
>= 23 - <= 3 | π Oh! working late night |
Configurable Default Options
{
"emoji": true,
"morning": "Good Morning",
"noon": "Good Afternoon",
"evening": "Good Evening",
"night": "Good Night",
"midnight": "Oh! working late night",
}
Sample Code
var greet = require("greet-visitor");
greet();
// Based on system default time it will show different messages. as mentioned above
Sample Code with Option Change
var greet = require("greet-visitor");
greet({emoji: false, noon: "Good noon !"});
// Output- at noon
"Good noon !"
// Output- in morning
"Good Morning"
Top comments (4)
Good job dude
Thanks alot..
Guys i have upgrade the package. added mid night support
for discussion on Product hunt - producthunt.com/discussions/greet-...