Customizable, easy-to-use, zero-dependency read time calculator.
Typedefinitions are built-in
- Using NPM:
npm install calculate-readtime --save
- Using Yarn:
yarn add calculate-readtime
// Simple usage
const { calculate } = require("calculate-readtime");
const myText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
calculate(myText); // => returns "less than a minute"
/* -------------------------------------------------------------------- */
// Advanced usage
const { calculate } = require("calculate-readtime");
const myText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
const options = {
singular: "dakika",
plural: "dakika",
lessThanOne: "bir dakikadan kısa",
wpm: 200,
};
calculate(myText, options); // => returns "bir dakikadan kısa"
Name | Type | Required | Default |
---|---|---|---|
wpm | Number | ❌ | 200 |
lessThanOne | String | ❌ | less than a minute |
singular | String | ❌ | minute |
plural | String | ❌ | minutes |
Feel free to use GitHub's features.