hello-international

2.2.1 • Public • Published

Hello-International - Common Greetings in 10+ Languages

Travis npm npm codecov coverage semantic-release Commitizen friendly

Installation

npm install hello-internation --save

How to use

var lib = require('hello-international');
 
setInterval(function () {
    console.log(lib.getRandomGreeting('hello'));
 }, 1000);
 
console.log(lib.getRandomGreeting());

Available APIs

  • Properties

    • lib.all: all the language data
    • lib.allMessages: return all supported messages, currently only support 'hello', 'goodbye'
    • lib.numberOfLanguages: totol number of supported languages
    • lib.languageList: all supported languages in an array
    • lib.randomIndex: return a random Index, userful if you want to do something before getting the random language / greeting
  • Methods:

    • lib.getRandomGreeting(optionalMessageArg, optionalLanguageArg): random greeting, if optionalMessageArg and optionalLanguageArg are provided and valid, will return specified greeting data

    • lib.getRandomLanguage(): return a random Language

    • lib.randomGreetings(optionalCount): return a list of random greetings, if the count is not specified or not valid, will only return one random greeting

Author: Audrey

Package Sidebar

Install

npm i hello-international

Weekly Downloads

6

Version

2.2.1

License

MIT

Last publish

Collaborators

  • audreyli