@jooger/word-counter
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

@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

Readme

Keywords

Package Sidebar

Install

npm i @jooger/word-counter

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

16.2 kB

Total Files

10

Last publish

Collaborators

  • jooger