Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        


go-readingtime


Estimate how long it takes to read a text

Coded with 💙 by edoardottt


go action


go report card


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).
[edoardoottavianelli.it](https://www.edoardoottavianelli.it) to contact me.