draft-read-time

Get read time from a Draft.js content state, based on Medium algorithm.


Keywords
draft, draft-js, medium, read, time
License
MIT
Install
npm install draft-read-time@0.1.0

Documentation

Draft ReadTime

Get read time from a Draft.js content state, based on Medium algorithm.

Installation

npm install draft-read-time

Usage

Simply import Draft ReadTime:

// ES5
var readTime require('draft-read-time');

// ES6
import readTime from 'draft-read-time';   

Get read time by passing a Draft.JS content state to readTime function:

var time = readTime(contentState); // Returns time in minutes

Contributing

Pull requests are welcomed!