From 054c3b13501e3f646a5ad2243f6b1070914758a6 Mon Sep 17 00:00:00 2001 From: William Wong Date: Sat, 29 Apr 2017 21:20:09 +0800 Subject: [PATCH] Update README.md --- CHANGELOG.md | 12 ++++++++++++ README.md | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bb2d1d1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [1.0.0] +### Changed +- Requires Node.js 7.6.0 for async/await statement +- Remove dependencies to Bluebird +- Remove web browser support (will redo later) +- Updated database diff --git a/README.md b/README.md index 3d3d9f4..eb3c6ce 100644 --- a/README.md +++ b/README.md @@ -7,18 +7,20 @@ OpenCC is a translation library for Traditional and Simplified Chinese with dict `node-opencc` is a brand new project that imports OpenCC database and test case, and translates text without installing any native components. ## Usage -You can only access `node-opencc` programmatically. Since dictionaries are huge, they are loaded asynchronously with Promise interface. Thus, all translations on `node-opencc` will return `thenable`. + +You can only access `node-opencc` programmatically. Since dictionaries are huge, they are loaded asynchronously with Promise interface. Thus, all translations on `node-opencc` will be completed in Promise fashion. For example, ``` const opencc = require('node-opencc'); -opencc.hongKongToSimplified('滑鼠').then(result => result === '鼠标'); -opencc.traditionalToHongKong('僞').then(result => result === '偽'); +await opencc.hongKongToSimplified('滑鼠') === '鼠标'; +await opencc.traditionalToHongKong('僞') === '偽'; ``` `node-opencc` supports multiple type of translations: + * Hong Kong to Simplified Chinese (`hongKongToSimplified`) * Simplified Chinese to Hong Kong (`simplifiedToHongKong`) * Simplified Chinese to Traditional Chinese (`simplifiedToTraditional`) @@ -37,9 +39,11 @@ Although `node-opencc` tries to redo `OpenCC` with pure JavaScript, there are fe * Use `withPhrases` options ## Changelog -* 2016-02-25 (0.0.2): First public release + +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!