JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q49536F
  • License MIT

Utility collections for making Japanese text old-fashioned.

Package Exports

  • kyujitai

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kyujitai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

kyujitai.js

Build Status Greenkeeper badge

Utility collections for making Japanese text old-fashioned.

install

npm install kyujitai

Use

const Kyujitai = require('kyujitai');
const kyujitai = new Kyujitai((error) => {
    kyujitai.encode('旧字体'); //=> '舊字體'
});

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 string
  • options: [Object]
    • options.IVD: [Boolean] true if you want to allow IVS for the encoded string. Default is false.
  • Returns: [String] Output string
kyujitai.encode('旧字体'); //=> '舊字體'

kyujitai.encode('画期的図画'); //=> '劃期的圖畫'

kyujitai.encode('弁明'); //=> '辯明'
kyujitai.encode('弁償'); //=> '辨償'
kyujitai.encode('花弁'); //=> '花瓣'
kyujitai.encode('弁髪'); //=> '辮髮'

kyujitai.decode(string, [options])

Decode string from kyujitai to shinjitai.

  • string: [String] Input string
  • options: [Object]
  • Returns: [String] Output string