https://github.com/fengkx/simplecc-wasm
基于 simplecc-rs 的 opencc 简单替代 (WASM)
https://github.com/fengkx/simplecc-wasm
node-module opencc wasm
Last synced: about 1 year ago
JSON representation
基于 simplecc-rs 的 opencc 简单替代 (WASM)
- Host: GitHub
- URL: https://github.com/fengkx/simplecc-wasm
- Owner: fengkx
- License: mit
- Created: 2021-03-05T07:16:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-14T02:31:21.000Z (over 1 year ago)
- Last Synced: 2025-04-06T04:06:31.061Z (about 1 year ago)
- Topics: node-module, opencc, wasm
- Language: Rust
- Homepage: https://fengkx.github.io/simplecc-wasm/
- Size: 2.54 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simplecc-wasm
> 基于 [simplecc-rs](https://github.com/sorz/simplecc-rs) 的 opencc 简单替代
_编译成 WASM 摆脱编译 Node Addon 的烦恼_
```bash
npm i simplecc-wasm
```
# Usage
```js
// Node.js
import { simplecc } from "simplecc-wasm";
// const { simplecc } = require("simplecc"); // commonjs
simplecc("发财了去植发", "s2t"); // '發財了去植髮'
// web
import init, { simplecc } from "simplecc-wasm";
await init();
simplecc("发财了去植发", "s2t"); // '發財了去植髮'
// There is a react app in demo/web path
```
## 配置 Configurations
[Opencc 配置中的一部分](https://github.com/BYVoid/OpenCC#configurations-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)
```plain
"s2t"
"t2s"
"s2tw"
"s2hk"
"s2twp"
"hk2s"
```