ewts
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

ewts

WASM-module to convert text from EWTS (Extended Wylie Transliteration Scheme) to Tibetan Unicode symbols

emaho


Fully compliant with the standard. See all rules on The Tibetan and Himalayan Library's site and tests on them here in rules_test.rs file.

It is part of set of apps/libs called ewts-rs. See more here

Installation

npm install ewts

Usage

Main module in package ('ewts/index.js') at this time can only be used with bundlers (webpack, rollup, etc.). If you don't use them, you can import submodule that natively supported by nodejs(ewts/nodejs) or by browsers ('ewts/web')

More info about difference between submodules in ewts package can be found on wasm-pack documentation:

  • ewts(ewts/index.js etc.) built with --target bundler flag
  • ewts/nodejs with --target nodejs
  • and ewts/web built with --target web flag
import {EwtsConverter} from 'ewts'
//                  or from 'ewts/nodejs'
//                  or from 'ewts/web'

const converter = new EwtsConverter()

const ewtsStr = "oM ma Ni pad+me hU~M/"

const tibUnicodeStr = converter.ewtsToUnicode(ewtsStr)

console.log(tibUnicodeStr)
// "ཨོཾ་མ་ཎི་པདྨེ་ཧཱུྃ།"

Examples

Version built for bundlers is used for demo page: sources and result.

Other examples stored at ./examples dir.

To view it at work do:

git clone https://github.com/emgyrz/ewts-rs.git
cd ewts-rs/ewts-wasm/examples

npm i

# prints to console conversion result
node ./usage_in_node.js

# opens browser with simple page where `ewts` is used
npx http-server . -o "/usage_in_browser_without_bundlers.html"

Readme

Keywords

Package Sidebar

Install

npm i ewts

Weekly Downloads

4

Version

0.1.6

License

MIT OR Apache-2.0

Unpacked Size

189 kB

Total Files

14

Last publish

Collaborators

  • emgyrz