New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

reading_time

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reading_time

display medium style read times for blocks of text

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Reading Time

Inspired by Medium, Reading Time is a simple, javascript snippet used to display an estimated time to read some text.

Rewrite of https://github.com/michael-lynch/reading-time (removes jquery and DOM manipulation, usable in Nodejs as well)

##Usage##


var $element = document.querySelector('.eta');
var text = 'Some text here';
var options = {}; // see available options below

var timing = readingTime(text, options);

//
// readingTime returns an object with:
//
//  readingTime (the estimated time it will take to read the article)
//  wordCount   (count of all words)
//

$element.text = timing.readingTime;

##Options##

  • wordsPerMinute: WPM as part of the calculation (defaults: 270)
  • round: round up
  • lang: en/fr/de/es/nl/sk/cz

Keywords

medium

FAQs

Package last updated on 03 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts