https://github.com/edoardottt/go-readingtime
Estimate how long it takes to read a text
https://github.com/edoardottt/go-readingtime
go-library go-module go-package golang golang-library golang-module golang-tools read-time read-time-estimator reading-time reading-time-estimator
Last synced: 7 months ago
JSON representation
Estimate how long it takes to read a text
- Host: GitHub
- URL: https://github.com/edoardottt/go-readingtime
- Owner: edoardottt
- License: mit
- Created: 2023-12-12T15:42:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T08:57:06.000Z (over 1 year ago)
- Last Synced: 2025-02-01T03:09:53.455Z (over 1 year ago)
- Topics: go-library, go-module, go-package, golang, golang-library, golang-module, golang-tools, read-time, read-time-estimator, reading-time, reading-time-estimator
- Language: Go
- Homepage: https://edoardoottavianelli.it
- Size: 41 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
go-readingtime
Estimate how long it takes to read a text
Coded with 💙 by edoardottt
Install •
Usage •
Changelog •
Contributing •
License
Install 📡
----------
```console
go install github.com/edoardottt/go-readingtime/cmd/readt@latest
```
Usage 💡
----------
CLI tool
```console
readt
```
Golang module
```go
package main
import (
"fmt"
reading "github.com/edoardottt/go-readingtime"
)
func main() {
s := reading.RawEstimate(`Lorem ipsum dolor sit amet, consectetur...`)
fmt.Println(s) // 130
d := reading.Estimate(`Lorem ipsum dolor sit amet, consectetur...`)
fmt.Println(d) // 2m10s
h := reading.HumanEstimate(`Lorem ipsum dolor sit amet, consectetur...`)
fmt.Println(h) // 2 minutes
}
```
Read the [`package documentation here`](https://pkg.go.dev/github.com/edoardottt/go-readingtime).
Changelog 📌
-------
Detailed changes for each release are documented in the [release notes](https://github.com/edoardottt/go-readingtime/releases).
Contributing 🛠
-------
Just open an [issue](https://github.com/edoardottt/go-readingtime/issues) / [pull request](https://github.com/edoardottt/go-readingtime/pulls).
Before opening a pull request, download [golangci-lint](https://golangci-lint.run/usage/install/) and run
```bash
golangci-lint run
```
If there aren't errors, go ahead :)
License 📝
-------
This repository is under [MIT License](https://github.com/edoardottt/go-readingtime/blob/main/LICENSE).
[edoardottt.com](https://edoardottt.com/) to contact me.