Skip to content

chrisbuttery/reading-time

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

Reading time

Medium-esque reading stats in elm.

The happy Panda

elm package install chrisbuttery/reading-time

If article stats are your thing, you may also like elm-scroll-progress.

Usage

import ReadingTime

str = "I can't believe I ate the whole thing."

ReadingTime.stats str Nothing

{-|
 - { text = "1 min read", minutes = 0.04, time = 2400, words = 8 }
 -}

API

stats : String -> Maybe Float

Pass in a string of words to count and an optional float value to calculate word per minute (Default: 200).

ReadingTime.stats str (Just 300)

Example

Checkout the demos.

Building example

Install Create Elm App and run elm-app build or elm-app start inside of /example.

Tests

% npm install -g elm-test
% elm-test

chrisbuttery.com  ·  GitHub @chrisbuttery  ·  Twitter @buttahz  ·  elm-lang slack @butters

About

Medium-esque reading stats in elm.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages