Skip to content

SammyWhamy/readable-to-ms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readable-to-ms

Convert readable time to milliseconds

Installation

npm install readable-to-ms

Usage

const rtm = require('readable-to-ms');

rtm('1ms') // 1
rtm('1m') // 60000
rtm('1y') // 31556952000
rtm('1m 1s') // 61000 
rtm('Nope') // false 
rtm('1min this is cool!') // {ms: 60000, text: "this is cool!"} 
rtm('1 minute') // 60000 
rtm('5 secs') // 5000 
rtm('12 seconds 5 ms') // 12005
rtm('1 minute update in 1 hour') // {ms: 60000, text: "update in 1 hour"}

Testing

npm run test "input"

Author

👤 Sam Teeuwisse

License

Copyright © 2020 Sam Teeuwisse

This project is MIT licensed.

About

Convert readable time to milliseconds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published