Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 26 days 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 (11 months ago)
- Default Branch: main
- Last Pushed: 2024-05-11T07:55:15.000Z (6 months ago)
- Last Synced: 2024-05-11T08:45:33.199Z (6 months 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: 32.2 KB
- Stars: 2
- 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 •
LicenseInstall 📡
----------```console
go install github.com/edoardottt/go-readingtime/cmd/readt@latest
```Usage 💡
----------CLI tool
```console
readt
```Golang module
```go
package mainimport (
"fmt"reading "github.com/edoardottt/go-readingtime"
)func main() {
s := reading.RawEstimate(`Lorem ipsum dolor sit amet, consectetur...`)
fmt.Println(s) // 130d := reading.Estimate(`Lorem ipsum dolor sit amet, consectetur...`)
fmt.Println(d) // 2m10sh := 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).
[edoardoottavianelli.it](https://www.edoardoottavianelli.it) to contact me.