2.2.1 • Published 10 years ago

hello-international v2.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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

2.2.1

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.1.0-beta.0

10 years ago

1.0.0

10 years ago