
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@untemps/read-per-minute
Advanced tools
Class to parse a string and return an estimated reading time based on a lang rate
Class to parse a long text and return an estimated reading time based on a lang rate.
yarn add @untemps/read-per-minute
Import the functions:
import { parse, isLangExist, rates } from '@untemps/read-per-minute'
Call parse
with a string and a lang (see Override the value for a one-time parsing for an alternative usage):
parse('Long text', 'en')
The parse
function returns an object with the following properties:
Property | Description |
---|---|
time | The estimated reading time in minutes |
words | The number of words in the text |
rate | The rate value used to calculate the reading time |
Default rate values come from "How many words do we read per minute? A review and meta-analysis of reading rate" by Marc Brysbaert - Department of Experimental Psychology Ghent University
Lang | Rate |
---|---|
default | 200 |
ar | 181 |
zh | 260 |
nl | 228 |
en | 236 |
fi | 195 |
fr | 214 |
de | 260 |
he | 224 |
it | 285 |
ko | 226 |
es | 278 |
sv | 218 |
If the lang is not listed or is undefined, the default value will be used instead.
You can specify an entire custom rates object as the third parameter of parse
or isLangExist
:
const customRates = {
default: 220,
ar: 191,
zh: 255,
nl: 234,
en: 244,
}
parse('Long text', 'en', customRates)
isLangExist('en', customRates)
NOTE: Set a default
property in the object if you want the parsing to fallback to a specific value.
Otherwise, the static value will be used (rates.default
).
Simply pass the desired custom reading rate in words per minute instead of a language code:
// For very fast readers: 425 words per minute.
parse('Long text', 425)
NOTE: The custom reading rate must be greater than zero or the default value will be used.
FAQs
Class to parse a string and return an estimated reading time based on a lang rate
We found that @untemps/read-per-minute demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.