0.1.6 • Published 8 months ago

ewts v0.1.6

Weekly downloads
-
License
MIT OR Apache-2.0
Repository
github
Last release
8 months ago

ewts

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

emaho

See demo page

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"
0.1.6

8 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago