romanize-japanese
romanize-japanese is a Node.js ES Module port of hepburn
package. It's used to convert Hiragana/Katakana to Roman (or vice versa).
visit the original repository for more information about hepburn
.
This module also add a beautify parameter to the fromKana
hepburn function :
// classichepburn // outputs "KYOU"// beautifiedhepburn // outputs "kyo u"
installation
yarn add romanize-japanese
Usage
on a webpage
(note: node_modules
needs to be publicly accessible from the client)
in a node es module
console // outputs "mi mi"
or CommonJS script
console
In command line
$ yarn global add romanize-japanese$ romanize-japanese みみmi mi$
Known limitations
This module will only convert hiragana/katakana literals to roman but will not convert any Kanji characters.
Build (browser version)
- clone this repository
yarn install
to install the default dependencies (inpackage.json
)- (but for instance) if you want to build another version of
hepburn
useyarn add hepburn@<version>
- (but for instance) if you want to build another version of
- then run
yarn build
- now
build/romanize-japanese.mjs
will contain thehepburn
es module for browsers