### Install CarakanJS with NPM Source: https://masnormen.github.io/carakanjs Install the CarakanJS library using npm. ```bash $ npm install carakanjs ``` -------------------------------- ### Install CarakanJS with Yarn Source: https://masnormen.github.io/carakanjs Install the CarakanJS library using Yarn. ```bash $ yarn add carakanjs ``` -------------------------------- ### Write Pepet and Taling Sounds (Default Config) Source: https://masnormen.github.io/carakanjs Demonstrates writing Pepet (represented by 'x') and Taling (represented by 'e') sounds in Javanese script using the default configuration. ```javascript // pepet is "x" // taling is "e" toJavanese("es dawxt"); // => ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀ ``` -------------------------------- ### Write Pepet and Taling Sounds (useAccents = true) Source: https://masnormen.github.io/carakanjs Converts text to Javanese script with accents enabled, allowing for distinct representations of Pepet and Taling sounds. Accents can be represented by 'é', 'è', or 'e`'. ```javascript // pepet is "e" // taling is "é", "è", or "e`" (e + backtick) toJavanese("e`s dawet", {useAccents: true}); // or toJavanese("és dawet", {useAccents: true}); // => ꦲꦺꦱ꧀ꦢꦮꦼꦠ꧀ // example text from Wikipedia basa Jawa toJavanese( "référèndhum menika mutusaken Timor Wétan pisah", {useAccents: true} ); // => ꦫꦺꦥ꦳ꦺꦫꦺꦤ꧀ꦝꦸꦩ꧀ꦩꦼꦤꦶꦏꦩꦸꦠꦸꦱꦏꦼꦤ꧀ꦡꦶꦩꦺꦴꦂꦮꦺꦠꦤ꧀ꦥꦶꦱꦃ ``` -------------------------------- ### Convert Text to Javanese Script with Default Options Source: https://masnormen.github.io/carakanjs Converts a given string to Javanese script using default library options. The `useAccents` option is false, while `useSwara` and `useMurda` are true by default. ```javascript import { toJavanese } from "carakanjs"; let x = toJavanese("blumbang gxmblundhung kxmambang"); // with default configs (optional) let x = toJavanese("blumbang gxmblundhung kxmambang", {useAccents: false, useSwara: true, useMurda: true}) console.log(x) // => ꦧ꧀ꦭꦸꦩ꧀ꦧꦁꦒꦼꦩ꧀ꦧ꧀ꦭꦸꦤ꧀ꦝꦸꦁꦏꦼꦩꦩ꧀ꦧꦁ ``` -------------------------------- ### toLatin(input) Source: https://masnormen.github.io/carakanjs Converts a string of Javanese script into its equivalent Latin script representation. ```APIDOC ## `toLatin(input)` ### Description Returns a string of Latin script converted from an `input` of Javanese script. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### `input` Type: `string` A string of Javanese script which will be transliterated into Latin script. ``` -------------------------------- ### Write Aksara Ganten & Panjingan Source: https://masnormen.github.io/carakanjs Converts text with Aksara Ganten and Panjingan characters into Javanese script. ```javascript toJavanese("kreta krxtxg, lxmah rxgxd"); // => ꦏꦿꦺꦠꦏꦽꦠꦼꦒ꧀‌ꦊꦩꦃꦉꦒꦼꦢ꧀ ``` -------------------------------- ### Write Pada (Punctuations) in Javanese Script Source: https://masnormen.github.io/carakanjs Converts standard punctuation marks into their Javanese script equivalents. ```javascript toJavanese("{<||,:.'":()>}"); // => ꧁꧌꧋꧋꧈꧇꧉꧊꧊꧇꧊꧊꧍꧂ ``` -------------------------------- ### CarakanHelper Source: https://masnormen.github.io/carakanjs A namespace containing various helper functions for the Carakan.js engine, facilitating conversions between Latin and Javanese scripts. ```APIDOC ## `CarakanHelper` ### Description A namespace which contains various helper for the engine to convert Latin letters from and into Javanese Script. ``` -------------------------------- ### Convert Javanese Script to Latin Source: https://masnormen.github.io/carakanjs Use `toLatin` to convert a Javanese script string back into its Latin representation. ```javascript toLatin("ꦲꦏ꧀ꦱꦫꦗꦮ") // Output: aksara jawa ``` -------------------------------- ### toJavanese(input, config?) Source: https://masnormen.github.io/carakanjs Converts a string of Latin characters into Javanese script. It supports configuration options for accent handling and the use of specific Javanese script forms. ```APIDOC ## `toJavanese(input, config?)` ### Description Returns a string of Javanese script converted from `input`, using the set `config`s. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters #### `input` Type: `string` A string of Latin character which will be transliterated into Javanese script. #### `config.useAccents` Type: `boolean`, default: `false` A boolean indicating whether Carakan.js should convert the input string with accents. There are two modes of input: * **Non-accented mode (default)** In this mode, Carakan.js will treat the letter “x” as Pepet (schwa sound) and “e” as Taling (see examples above). * **Accented mode** The “formally and academically correct” way to write Javanese in Latin. Typically used in Wikipedia basa Jawa texts. In this mode, Carakan.js will treat the letter “e” as Pepet, “é”/”è”/”e`” as Taling. “x” will still be treated as Pepet (see examples above). Basically, the transliterator engine can only read string in non-accented mode. When `useAccents` is set to `true`, Carakan.js will convert the accented input into non-accented mode first, so then it can convert them into Javanese script. #### `config.useSwara` Type: `boolean`, default: `true` A boolean indicating whether Carakan.js should convert uppercase vowels (A, I, U, E, O) into Aksara Swara. If set to `false`, Carakan.js will render them as regular vowels sound written with the letter “ha”. #### `config.useMurda` Type: `boolean`, default: `true` A boolean indicating whether Carakan.js should convert some uppercase consonants (N, K, T, S, P, NY, G, B) into Aksara Murda. If set to `false`, Carakan.js will render them with their regular Javanese script character. ``` -------------------------------- ### Convert Javanese Script to Latin Source: https://masnormen.github.io/carakanjs Converts Javanese script (Aksara Jawa) back into Latin characters using the `toLatin` function. ```javascript import { toLatin } from "carakanjs"; let x = toLatin("ꦗꦼꦂ ꦧꦱꦸꦏꦶ ꦩꦮ ꦧꦺꦪ"); console.log(x) // => jer basuki mawa béya ``` -------------------------------- ### Write Angka (Numbers) in Javanese Script Source: https://masnormen.github.io/carakanjs Converts Arabic numerals into Javanese script, automatically enclosing them with pada pangkat (꧇) punctuation. ```javascript // pada pangkat (꧇) will be automatically added around numbers toJavanese("tanggal 17 bulan 8 taun 1945"); // => ꦠꦁꦒꦭ꧀꧇꧑꧗꧇ꦧꦸꦭꦤ꧀꧇꧘꧇ꦠꦲꦸꦤ꧀꧇꧑꧙꧔꧕꧇ ``` -------------------------------- ### Write Aksara Swara, Murda, and Rekan Source: https://masnormen.github.io/carakanjs Converts text containing Aksara Swara (vowels), Murda (capital letters), and Rekan (foreign sounds) into Javanese script. ```javascript toJavanese("GUSTI ALLAH YA KHALIK"); // => ꦓꦸꦯ꧀ꦡꦶꦄꦭ꧀ꦭꦃꦪꦏ꦳ꦭꦶꦑ꧀ ``` -------------------------------- ### Convert Latin to Javanese Script Source: https://masnormen.github.io/carakanjs Use `toJavanese` to convert a Latin string to Javanese script. The `config` object allows customization of accent handling and the use of Swara and Murda characters. ```javascript toJavanese("aksara jawa") // Output: ꦲꦏ꧀ꦱꦫꦗꦮ ``` ```javascript toJavanese("aksara jawa", { useAccents: true }) // Output: ꦲꦏ꧀ꦱꦫꦗꦮ ``` ```javascript toJavanese("aksara jawa", { useSwara: false }) // Output: ꦲꦏ꧀ꦱꦫꦗꦮ ``` ```javascript toJavanese("aksara jawa", { useMurda: false }) // Output: ꦲꦏ꧀ꦱꦫꦗꦮ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.