An open API service indexing awesome lists of open source software.

https://github.com/begmaroman/reading-time

Reading time helps to estimate how long an article will take to read
https://github.com/begmaroman/reading-time

article blog estimation estimator golang reading-time

Last synced: about 1 year ago
JSON representation

Reading time helps to estimate how long an article will take to read

Awesome Lists containing this project

README

          

# reading-time

`reading-time` is the GoLang tool that helps you estimate how long an article will take to read.
It works perfectly with plain text, but also with `markdown` or `html`.

Note that it's focused on performance and simplicity, so the number of words it will extract from other formats than plain text can vary a little. But this is an estimation right?

## Installation

```bash
go get github.com/begmaroman/reading-time
```

## Usage

```go
package main

import (
"fmt"

readingtime "github.com/begmaroman/reading-time"
)

func main() {
myArticle := "some long long long text with ##markdown stuff and html"
estimation := readingtime.Estimate(myArticle)
fmt.Println(estimation.Text) // "1 min read"
fmt.Println(estimation.Duration) // 1 min
fmt.Println(estimation.Words) // 10
}

```