Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 812 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 812 Bytes

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.