npm.io
0.1.1 • Published 7 years ago

ander

Licence
BSD
Version
0.1.1
Deps
0
Size
77 kB
Vulns
0
Weekly
0

ander

Render a list of items as dictated by the locale. The formats are extracted from the CLDR.

Installation

npm install ander

Syntax

ander(itemsArray, localeId = 'en-US')

Returns a string with the formatted list items.

Examples

const ander = require('ander');

// American English:
console.log(ander(['foo', 'bar', 'quux'], 'en-US'));
// foo, bar, and quux

// Arabic:
console.log(ander(['foo', 'bar', 'quux'], 'ar'));
// foo، bar، وquux