switch-chinese

1.0.2 • Public • Published

簡繁自由切換

切換簡體中文與正體中文

NPM License

演示

  • 基礎用法
import Stcasc from './stcasc.lib.js';
let stcasc = Stcasc();
console.log(stcasc.traditionalized("香烟 香烟袅袅 烟雾里 里长面子 吃干面 干 把考卷发回来 卷发"));
//香菸 香煙裊裊 煙霧裡 里長面子 吃乾麵 幹 把考卷發回來 捲髮
  • 透過 npm 安裝
npm install switch-chinese
import Stcasc from 'switch-chinese';
  • 轉正體中文
stcasc.traditionalized("中文");
  • 轉簡體中文
stcasc.simplized("中文");
  • 添加快取
let cache = loadCacheAtYourWay();
let stcasc = Stcasc(cache);
saveCacheAtYourWay(stcasc.cache);
  • 自訂簡繁切換
const custom = {
	"身份": "身分",
	"转义": "跳脫",
	"转换": "轉檔",
	"软件": "軟體"
};
let stcasc = Stcasc(cache, custom);

Package Sidebar

Install

npm i switch-chinese

Weekly Downloads

22

Version

1.0.2

License

MIT

Unpacked Size

52.4 kB

Total Files

3

Last publish

Collaborators

  • hoothin