words-to-time-converter
v1.1.0
Published
A simple library that turns words to time
Downloads
42
Maintainers
Readme
words-to-time-converter
⏲️ Simple words to time converter with options to choose output format: minutes, seconds or hours
Install
npm install words-to-time-converter
or
yarn add words-to-time-converter
Usage
- There are 3 functions to choose from by now. The speed parameter is optional. It can be 'slow', 'average' or 'fast'. If you don't write it,the default will be 'average'
- wordsToMinutes(text, speed)
- wordsToSeconds(text, speed)
- wordsToHours(text, speed)
const {wordsToMinutes, wordsToHours, wordsToSeconds} = require('words-to-time-converter');
//0.9 minutes
wordsToMinutes('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'slow');
//0.01 hours
wordsToHours('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.', 'average');
//42 seconds
wordsToSeconds('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.');
//0.7 minutes
wordsToMinutes('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.');
Props
Simple use, no need to do it on your own. Ideal feature to use in your blog or website.
Contribute
Contributions are always welcome! Please read the contribution guidelines first.
⭐ If you liked the library, please consider giving me a star. Thank you!
License
Copyright © Svetloslav Novoselski