kyujitai.js
Utility collections for making Japanese text old-fashioned.
install
npm install kyujitai
Use
const Kyujitai = ;const kyujitai = { kyujitai; //=> '舊字體'};
Usage
new Kyujitai([options], [callback])
Constructor.
options
: [Object]callback
: [Function(error)] Called when construction completed.error
: [Error] Supplied if construction failed.
kyujitai.encode(string, [options])
Encode string from shinjitai to kyujitai.
string
: [String] Input stringoptions
: [Object]options.IVD
: [Boolean]true
if you want to allow IVS for the encoded string. Default is false.
- Returns: [String] Output string
kyujitai; //=> '舊字體' kyujitai; //=> '劃期的圖畫' kyujitai; //=> '辯明'kyujitai; //=> '辨償'kyujitai; //=> '花瓣'kyujitai; //=> '辮髮'
kyujitai.decode(string, [options])
Decode string from kyujitai to shinjitai.
string
: [String] Input stringoptions
: [Object]- Returns: [String] Output string