Installations
npm install reading-time-estimator
Developer
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
Yes
Node Version
20.8.1
NPM Version
10.5.0
Statistics
40 Stars
1,732 Commits
13 Forks
4 Watching
4 Branches
10 Contributors
Updated on 28 Nov 2024
Bundle Size
1.56 kB
Minified
900.00 B
Minified + Gzipped
Languages
TypeScript (80.58%)
JavaScript (19.42%)
Total Downloads
Cumulative downloads
Total Downloads
315,299
Last day
4.1%
580
Compared to previous day
Last week
35.6%
3,763
Compared to previous week
Last month
6.1%
13,915
Compared to previous month
Last year
77.4%
148,320
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
19
reading-time-estimator
A medium's like reading time estimator with internationalization support.
Documentation
Reading Time Estimator was created to provide an estimate of how long to read an article or blog as seen on medium.
Installation
With NPM
1 npm install reading-time-estimator
or Yarn
1 yarn add reading-time-estimator
API
The api is fairly simple. Here are the types definition for this module.
It is a simple function that takes the data as a required argument with the words per minute and locale as optional arguments.
Per default the locale is set to english en
.
Per default the word per minute is set to 300
.
At the moment there is only 12 supported locales: en
, fr
, es
, pt-br
, cn
, ja
, de
, tr
, ro
, bn
, sk
and cs
.
Usage
Try it live here
1import { readingTime } from 'reading-time-estimator' 2 3const text = 'some text to parse' 4 5// default options 6const result = readingTime(text, 10) 7 8// output: 9// { 10// minutes: 4, 11// words: 43, 12// text: `4 min read` 13// } 14 15// with french locale 16const result = readingTime(text, 10, 'fr') 17 18// output: 19// { 20// minutes: 4, 21// words: 43, 22// text: `4 min de lecture` 23// }
Why Not ...?
reading-time
This package does not offer internationalization support which was a must for me.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Lucien Bénié 💻 📖 | Victor Sierra 💻 | ZhangC 💻 | Rich11 💻 📖 | Matheus Oliveira 💻 | Can Güven 💻 | Alexander Strutz 💻 |
凝结尾迹 💻 | Muhammad Faisal Amin 💻 | Oliver Groma 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
No vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
SAST tool is run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Info: all commits (30) are checked with a SAST tool
Reason
6 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Warn: no topLevel permission defined: .github/workflows/commintlint.yml:1
- Warn: no topLevel permission defined: .github/workflows/format.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:74: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/codeql-analysis.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/commintlint.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/commintlint.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/commintlint.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/commintlint.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/commintlint.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/commintlint.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/format.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/format.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/format.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/format.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/format.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/format.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/test.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lbenie/reading-time-estimator/test.yml/main?enable=pin
- Info: 0 out of 13 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 6 third-party GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
Project has not signed or included provenance with any releases.
Details
- Warn: release artifact v1.11.0 not signed: https://api.github.com/repos/lbenie/reading-time-estimator/releases/149435454
- Warn: release artifact v1.10.0 not signed: https://api.github.com/repos/lbenie/reading-time-estimator/releases/146925990
- Warn: release artifact v1.9.4 not signed: https://api.github.com/repos/lbenie/reading-time-estimator/releases/135582117
- Warn: release artifact v1.9.3 not signed: https://api.github.com/repos/lbenie/reading-time-estimator/releases/135313961
- Warn: release artifact v1.9.2 not signed: https://api.github.com/repos/lbenie/reading-time-estimator/releases/132303054
- Warn: release artifact v1.11.0 does not have provenance: https://api.github.com/repos/lbenie/reading-time-estimator/releases/149435454
- Warn: release artifact v1.10.0 does not have provenance: https://api.github.com/repos/lbenie/reading-time-estimator/releases/146925990
- Warn: release artifact v1.9.4 does not have provenance: https://api.github.com/repos/lbenie/reading-time-estimator/releases/135582117
- Warn: release artifact v1.9.3 does not have provenance: https://api.github.com/repos/lbenie/reading-time-estimator/releases/135313961
- Warn: release artifact v1.9.2 does not have provenance: https://api.github.com/repos/lbenie/reading-time-estimator/releases/132303054
Score
4.1
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More