@nisarg99/timeconvertion-js
v0.1.0
Published
A NPM package that exports functions to convert miliseconds to timestring ( hh:mm:ss ) and convert timestring to milliseconds.
Downloads
13
Maintainers
Readme
TimeConversion-Js
A NPM package that exports functions to convert miliseconds to timestring ( hh:mm:ss ) & convert timestring to milliseconds.
Installation
TimeConversion-Js requires Node.js v4+ to run.
Install the dependencies and devDependencies and start the server.
$ npm install @nisarg99/timeconvertion-js
Development
Convert Microseconds to timestring
var timeConversion = require('@nisarg99/timeconvertion-js')
var ms = '23456733' // microseconds which you want to convert
var timeString = timeConversion.ConvertMstoTimeString(ms)
console.log(timeString)
Convert Seconds to timestring
var timeConversion = require('@nisarg99/timeconvertion-js')
var seconds = "23457" // seconds which you want to convert
var timeString = timeConversion.ConvertSecondstoTimeString(seconds)
console.log(timeString)
Convert timestring to Microseconds
var timeConversion = require('@nisarg99/timeconvertion-js')
// options for timestring are ex. "09:45:56" , "36:07", "43"
var timeString = "09:45:56" // timestring which converts to milliseconds
var microSeconds = timeConversion.ConvertTimeStringtoMs(timeString)
console.log(microSeconds)
Cpnvert timestring to Seconds
var timeConversion = require('@nisarg99/timeconvertion-js')
// options for timestring are ex. "09:45:56" , "36:07", "43"
var timeString = "06:24:32" // timestring which converts to seconds
var seconds = timeConversion.ConvertTimeStringtoSeconds(timeString)
console.log(seconds)
Tests :
Tests are using mocha, to run the tests use:
$ npm test
Found a Issue :
Please tell us here
Want to contribute? Great!
License
MIT
Free Software, Hell Yeah!