Go Back to projects

lesetid

/leːsətiːd/, Norwegian: “lesetid”

✨ Features

📦 Installation

npm install lesetid

📚 Usage

import { estimate } from "lesetid";

const {
  minutes,
  rawMinutes,
  words
} = estimate("Hello World!");

or you can use the streaming approach

import { Readable } from "node:stream";
import { createReadingTimeStream } from "lesetid/stream";

const readingTimeStream = await fetch("https://next.luxass.dev/projects/eslint-config/raw")
  .then((res) => Readable.from(res.body, {
    encoding: "utf-8",
  }))
  .then((body) => body.pipe(createReadingTimeStream()));

readingTimeStream.on("data", (data) => {
  console.info(data);
});

🙌 Acknowledgements

I would like to thank ngryman for his work on reading-time which inspired me to create this package.

📄 License

Published under MIT License.