2.0.0 • Published 9 years ago

myanmar-names-js v2.0.0

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

myanmar-names.js

Sort a list of Myanmar language / Burmese names using JavaScript

Removes prefixes and sorts by official alphabetic order (yes, you will need a library for this, not .sort())

On the client-side, this library uses Intl.Collator. On the server, it cannot get Intl.Collator from NodeJS or the Intl npm module, so it uses an approximation.

Usage

Pass an array of names:

output = myanmarNameSort([
  "ဦးလှမြင့်",
  "ဦးမော"
]);
> ["ဦးမော", "ဦးလှမြင့်"]

Pass an array of objects, and a function to extract the name:

output = myanmarNameSort(candidates, function(candidate) {
  return candidate.full_name;
});

License

Prefixes from Wikipedia under a Creative Commons license

Open Sourced with an MIT License