@jooger/word-counter
v1.1.0
Published
A lib for counting your words and reading time
Downloads
4
Readme
@jooger/word-counter
A lib for counting your words and reading time
Install
// npm
$ npm install @jooger/word-counter
// yarn
$ yarn add @jooger/word-counter
Usage
import { wordCount, timeCalc } from '@jooger/word-counter'
const content = 'this 中文 is a 单词'
const count = wordCount(content, count => {
return count * 2
}) // the origin count is 7, the transformed data is 14
const time = timeCalc(content, {
cn: 300, // the number of cn words per minute read
en: 160 // the number of en words per minute read
}) // time is 1
License
MIT