1.1.0 • Published 5 years ago

@jooger/word-counter v1.1.0

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

@jooger/word-counter

styled with prettier Travis Coveralls Dev Dependencies

NPM NPM

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

1.1.0

5 years ago

1.0.0

5 years ago