Virama-JS (ဝိရာမ)

Logo

NPM version NPM downloads DEPENDENCIES Build Status Scrutinizer Code Quality Coverage

Myanmar font (browser default font) detector and Zawgyi <=> Unicode Converter for nodejs.

About

Converter functions are come from Rabbit-Converter.

Installation

Install using npm:

npm install virama-js --save

Using CDN:

<script src="https://unpkg.com/virama-js@1.0.6/dist/virama.min.js"></script>

Usage


var Virama = require("virama-js");



Virama.textToWrite("ပြည်ထောင်စုဖောင့်");
// Output4ZawgyiUser: ပွညျထောငျစုဖောငျ့ 
// Output4UniUser: ပြည်ထောင်စုဖောင့်

Virama.textToWrite("ျပည္ေထာင္စုေဖာင့္");
// Output4ZawgyiUser: ပြည်ထောင်စုဖောင့်
// Output4UniUser: ျပည္ေထာင္စုေဖာင့္

Virama.textToRead("ပြည်ထောင်စုဖောင့်");
// Output4ZawgyiUser: ျပည္ေထာင္စုေဖာင့္
// Output4UniUser: ပြည်ထောင်စုဖောင့်

Virama.zg2uni("ျပည္ေထာင္စုေဖာင့္");
// Output: ပြည်ထောင်စုဖောင့်

Virama.uni2zg("ပြည်ထောင်စုဖောင့်");
// Output: ျပည္ေထာင္စုေဖာင့္

Virama.getBrowserFont();
// Output4ZawgyiUser: zawgyi
// Output4UniUser: uni

Virama.isUnicodeUser();
// Output4ZawgyiUser: false
// Output4UniUser: true

Change Log

v1.0.6

  1. Update uni2zg rule for converter

v1.0.4

  1. used typescript
  2. changed Virama.write() to Virama.textToWrite()
  3. changed Virama.read() to Virama.textToRead()

Contributing

  1. Fork it ( https://github.com/thixpin/Virama-JS )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT