Medium-esque reading stats in elm.
Elm
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src
tests
.gitignore
README.md
elm-package.json

README.md

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