# node-opencc

> Conversion between Traditional Chinese and Simplified Chinese in pure Node.js

Latest version **2.0.1** (published 2017-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-opencc
pnpm add node-opencc
yarn add node-opencc
bun add node-opencc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2017-08-31 |
| First published | 2016-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 7.6.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 64 |
| Author | William Wong |
| Maintainers | compulim, spyip |

## Links

- npm: https://www.npmjs.com/package/node-opencc
- Repository: https://github.com/compulim/node-opencc
- Homepage: https://github.com/compulim/node-opencc#readme
- Issues: https://github.com/compulim/node-opencc/issues
- npm.io page: https://npm.io/package/node-opencc

## Recent versions

- 2.0.1 (latest) — 2017-08-31
- 2.0.0 — 2017-08-30
- 1.0.0 — 2017-04-29
- 0.0.2 — 2016-02-25
- 0.0.1 — 2016-02-25

## README

# Translates between Traditional and Simplified Chinese in pure Node.js [![Build Status](https://travis-ci.org/compulim/node-opencc.svg?branch=master)](https://travis-ci.org/compulim/node-opencc)

(This library use [OpenCC](https://github.com/byvoid/opencc) for its dictionary database and test data)

OpenCC is a translation library for Traditional and Simplified Chinese with dictionary of localized phrases and verbs. But it only runs on Python (or Node.js with Python installed).

`node-opencc` is a brand new project that imports OpenCC database and test case, and translates text without installing any native components.

## Usage

`node-opencc` supports Node.js and modern browsers (with Webpack).

```
const opencc = require('node-opencc');

opencc.hongKongToSimplified('滑鼠') === '鼠标';
opencc.traditionalToHongKong('僞') === '偽';
```

`node-opencc` supports the following types of translations:

| Function name                   | Translation                               |
| ------------------------------- | ----------------------------------------- |
| `hongKongToSimplified`          | Hong Kong to Simplified Chinese           |
| `simplifiedToHongKong`          | Simplified Chinese to Hong Kong           |
| `simplifiedToTraditional`       | Simplified Chinese to Traditional Chinese |
| `simplifiedToTaiwan`            | Simplified Chinese to Taiwan              |
| `simplifiedToTaiwanWithPhrases` | Simplified Chinese to Taiwan with phrases |
| `traditionalToHongKong`         | Traditional Chinese to Hong Kong          |
| `traditionalToSimplified`       | Traditional Chinese to Simplified Chinese |
| `traditionalToTaiwan`           | Traditional Chinese to Taiwan             |
| `taiwanToSimplified`            | Taiwan to Simplified Chinese              |
| `taiwanToSimplifiedWithPhrases` | Taiwan to Simplified Chinese with phrases |

## What's not working

Although `node-opencc` tries to redo `OpenCC` with pure JavaScript, there are features that are not working as in `OpenCC`. `node-opencc` currently _do not_ support the following features:

* Multiple alternative phrases, verbs, and characters
* Use `withPhrases` options

## Changelog

Please refer to change log [here](CHANGELOG.md).

## Contribution

You may want to head to [OpenCC](https://github.com/byvoid/opencc) for dictionary contribution.

Love this extension? [Star](https://github.com/compulim/node-opencc/stargazers) us!

Want to make this extension even more awesome? [Send us your wish](https://github.com/compulim/node-opencc/issues/new/).

Hate how it is working? [File an issue](https://github.com/compulim/node-opencc/issues/new/) to us.

To contribute to the code base of `node-opencc`, please file a pull request with unit tests.

---
_Source: https://npm.io/package/node-opencc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
