npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sunda.js

v1.0.2

Published

Sunda.js is a small library for converting/transliterating Latin into Sundanese script (Aksara Sunda Baku), or vice versa.

Downloads

32

Readme

Sunda.js

npm size madein

Sunda.js is a small library for converting/transliterating Latin into Sundanese script (Aksara Sunda Baku), or vice versa.

:eyes: Why this library?

Sunda.js is based off of my other project, Carakan.js, which is a transliterator library for Javanese script. After researching about the Sundanese script, I found that the Sundanese writing system is similar, and even a lot simpler than the Javanese one. Then, I realized that the same algorithm could be used to transliterate Latin into it. As I see that there's no library for transliterating Latin into Sundanese script yet (and vice versa), I decided to make one.

Sunda.js is also fast. It just needs around 2 milliseconds to convert a simple sentence.

:open_book: Table of Contents

:rocket: Features

Currently, Sunda.js can handle these features:

  • Aksara Ngalagéna
  • Aksara Ngalagéna for foreign sounds (f, q, v, x, z, kh, sy)
  • Aksara Swara
  • All rarangkén
  • Angka
  • ...and many more (see the code yourself!)

:package: Installation

NPM:

$ npm install sunda.js

Yarn:

$ yarn add sunda.js

:keyboard: Usage

Latin → Sundanese using toSundanese()

Basic example

import { toSundanese } from "sunda.js";

let x = toSundanese("Wih, geulis euy!");
console.log(x)

// => ᮝᮤᮂ, ᮌᮩᮜᮤᮞ᮪ ᮉᮚ᮪!

Writing basic vowels

let x = toSundanese("pa pi pu pe pé peu po p");
console.log(x)

// => ᮕ ᮕᮤ ᮕᮥ ᮕᮨ ᮕᮦ ᮕᮩ ᮕᮧ ᮕ᮪

Writing various Rerangkén

let x = toSundanese("Di Klatén, ada santri kyai tebang pohon buah pir");
console.log(x)

// => ᮓᮤ ᮊᮣᮒᮦᮔ᮪, ᮃᮓ ᮞᮔ᮪ᮒᮢᮤ ᮊᮡᮄ ᮒᮨᮘᮀ ᮕᮧᮠᮧᮔ᮪ ᮘᮥᮃᮂ ᮕᮤᮁ

Writing numbers

// pipe (|) will be automatically added around numbers

let x = toSundanese("tanggal 17 bulan 8 taun 1945");
console.log(x)

// => ᮒᮀᮌᮜ᮪ |᮱᮷| ᮘᮥᮜᮔ᮪ |᮸| ᮒᮅᮔ᮪ |᮱᮹᮴᮵|

Sundanese → Latin using toLatin()

Basic example

import { toLatin } from "sunda.js";

let x = toLatin("ᮝᮤᮂ, ᮌᮩᮜᮤᮞ᮪ ᮉᮚ᮪!");
console.log(x)

// => wih, geulis euy!

Detecting rerangkén when converting back to Latin

let x = toLatin("ᮓᮤ ᮊᮣᮒᮦᮔ᮪, ᮃᮓ ᮞᮔ᮪ᮒᮢᮤ ᮊᮡᮄ ᮒᮨᮘᮀ ᮕᮧᮠᮧᮔ᮪ ᮘᮥᮃᮂ ᮕᮤᮁ");
console.log(x)

// => di klatén, ada santri kyai tebang pohon buah pir

Writing numbers

// pipe (|) will be automatically removed from around numbers

let x = toLatin("ᮒᮀᮌᮜ᮪ |᮱᮷| ᮘᮥᮜᮔ᮪ |᮸| ᮒᮅᮔ᮪ |᮱᮹᮴᮵|");
console.log(x)

// => tanggal 17 bulan 8 taun 1945

Notes

  • In Latin -> Sundanese transliteration, you can use either uppercase (capital) or lowercase. The result will be the same.
  • In Sundanese -> Latin transliteration, pipe (|) immediately before and after numbers will be removed.
  • Other than pipe (|), all characters that's not Sundanese or Latin character (like dot, comma, semicolon, etc) will be output as it is.

:fire: API

Sunda.js package exports four things: functions toSundanese() & toLatin(), and also namespace SundaHelper and LatinHelper which contains various helper.

toSundanese(input)

Returns a string of transliterated Sundanese script, given Latin input.

input

Type: string

A string of Latin character which will be transliterated into Sundanese script. For examples, see the above section.

toLatin(input)

Returns a string of transliterated Latin script, given Sundanese script input.

input

Type: string

A string of Sundanese character which will be transliterated into Latin script. For examples, see the above section.

SundaHelper

A namespace which contains various helper for the engine to convert Latin letters into Sundanese Script.

LatinHelper

A namespace which contains various helper for the engine to convert Sundanese letters into Latin Script.

:toolbox: TODO

  • [x] support transliteration of Sundanese script back to Latin
  • [ ] support more punctuations from ancient Sundanese character (Bindu Surya, Bindu Panglong, etc)

:books: References