luh-calm-greet
v0.1.1
Published
Personalized & Contextual Greetings for Your Users
Maintainers
Readme
luh-calm-greet
Personalized and contextual greeting utility, inspired by Claude.
Installation
npm install luh-calm-greetbun i luh-calm-greetpnpm add luh-calm-greetUsage
import {
getContextualGreeting,
getGreeting,
getDayGreeting,
getSimpleGreeting,
} from "luh-calm-greet";
// Basic time-based greeting
console.log(getGreeting({ name: "Alice" }));
// "Good morning, Alice" (if it's morning)
// Contextual greeting with special occasions, time, and activity
const today = new Date();
const lastWeek = new Date(today);
lastWeek.setDate(today.getDate() - 8);
const birthdayUser = {
name: "Bob",
birthday: today,
};
console.log(getContextualGreeting(birthdayUser));
// "Happy birthday, Bob! 🎉"
const inactiveUser = {
name: "Charlie",
lastLoginDate: lastWeek,
};
console.log(getContextualGreeting(inactiveUser));
// "Long time no see, Charlie"
// Day of the week greeting
console.log(getDayGreeting({ name: "David" }));
// "Happy Friday, David" (if it's Friday)
// Simple greeting
console.log(getSimpleGreeting({ name: "Eve", currentHour: 14 }));
// "Good afternoon, Eve"