hello-international
v2.2.1
Published
Common Greetings in 10+ Languages
Downloads
11
Maintainers
Keywords
Readme
Hello-International - Common Greetings in 10+ Languages
###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