1.0.0 • Published 3 years ago

mx-ms v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

mxms

Mx ms is for converting time into milliseconds, you can also use this for economy commands :D

Table of contents

contents

Examples Converting Time-Format

Examples

mx('2 days')  // 172800000
mx('1d')      // 86400000
mx('10h')     // 36000000
mx('2.5 hrs') // 9000000
mx('2h')      // 7200000
mx('1m')      // 60000
mx('5s')      // 5000
mx('1y')      // 31557600000
mx('100')     // 100
mx('-3 days') // -259200000
mx('-1h')     // -3600000
mx('-200')    // -200

Converting-from-milliseconds

mx(60000)             // "1m"
mx(2 * 60000)         // "2m"
mx(-3 * 60000)        // "-3m"
mx(ms('10 hours'))    // "10h"

Time-Format-Written-Out

mx(60000, { long: true })             // "1 minute"
mx(2 * 60000, { long: true })         // "2 minutes"
mx(-3 * 60000, { long: true })        // "-3 minutes"
mx(ms('10 hours'), { long: true })    // "10 hours"

About

  • mx works for both Nodejs and Html browsers aswell
  • If a number is supplied to ms, a string with a unit is returned

    Bugs

  • Hello! If you have caught a bug in the mx package please join the mx-discord-server


Author

const authors = ["MxKay_.#2551"] //on Discord 👑
console.log(authors);
//returns the author of mx-ms