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
- Host: GitHub
- URL: https://github.com/begmaroman/reading-time
- Owner: begmaroman
- Created: 2020-05-18T05:56:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T21:17:17.000Z (about 2 years ago)
- Last Synced: 2025-03-30T02:21:46.405Z (about 1 year ago)
- Topics: article, blog, estimation, estimator, golang, reading-time
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}
```