Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

native-greetings

rehan.sathio11ISC1.0.1

Embrace global connections with native-greetings! Discover diverse country greetings in one place.

Greetings, Countries, International, Cultural, Salutations, Multicultural, Communication, Global, Etiquette, Language, Culture, Country, Codes, Social, Interactions, Diversity, Cross-Cultural, Worldwide, Hello, Multilingual, Connection, Traditions, Globalization, Greetings Collection, Country-Specific Greetings

readme

native-greetings

native-greetings is an npm package that offers a diverse collection of greetings for various countries. Retrieve greetings effortlessly based on country names, country codes, or international dialing codes within your JavaScript projects.

Installation

Install native-greetings via npm:

npm install native-greetings

Usage

const greetings = require('native-greetings');
// or
import {
  findGreetingByCountry,
  findGreetingByCountryCode,
  findGreetingByInternationalCode,
  randomGreeting,
} from 'native-greetings';

// Find greeting by country name
const greetingByCountry = findGreetingByCountry('Japan');
console.log(greetingByCountry); // Output: "こんにちは"

// Find greeting by country name
const greetingByCountry = findGreetingByCountry('Pakistan');
console.log(greetingByCountry); // Output: "Asalamualekum"

// Find greeting by country code
const greetingByCountryCode = findGreetingByCountryCode('FR');
console.log(greetingByCountryCode); // Output: "Bonjour"

// Find greeting by international code
const greetingByIntlCode = findGreetingByInternationalCode(91);
console.log(greetingByIntlCode); // Output: "Namaste"

// Get a random greeting
const randomGreeting = randomGreeting();
console.log(randomGreeting); // Output: Random greeting from the dataset

Functions

  • findGreetingByCountry(countryName): Find a greeting by country name.
  • findGreetingByCountryCode(countryCode): Find a greeting by country code.
  • findGreetingByInternationalCode(code): Find a greeting by international dialing code.
  • randomGreeting(): Get a random greeting from the collection.

License

This project is licensed under the MIT License.