0.1.6 • Published 4 years ago

epub-chinese-converter v0.1.6

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

epub-chinese-converter npm GitHub Workflow Status

A small util to convert epub files from Simplified Chinese to Traditional Chinese

Installation

npm install epub-chinese-converter --save

Usage

(See the test files under src/ for details)

  • Read epub file:
import {readEpub} from "epub-chinese-converter";
const book = await readEpub(BOOK_URL);
const { metadata, chapters } = book;
  • Conversion
import {createSimplifiedToTraditionalConverter} from "epub-chinese-converter";
const converter = createSimplifiedToTraditionalConverter();
const convertedBook = converter.convertBook(book);
const { metadata, chapters } = convertedBook;

Limitations

  1. As of v0.1.0, only translation from Simplified Chinese to Traditional Chinese is supported

Caveats

  1. (Help wanted) When using this package as a library in browser environment, only the converter part can be used , and it should be imported in this way:

    import {createSimplifiedToTraditionalConverter} from "epub-chinese-converter/dist/converter";

    Other error like this would be thrown:

    Module not found: Can't resolve 'aws-sdk' in 'node_modules\node-pre-gyp\lib'

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago