Converts milliseconds to a format like Spotify's track durations
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.codeclimate.yml
.gitignore
.npmignore
.prettierignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
renovate.json
tsconfig.json
tslint.json

README.md

Track duration

npm version Build Status Maintainability Test Coverage

Converts milliseconds to a format like Spotify's track durations.

Installation

npm install track-duration --save

Parse

parse(milliseconds: number): string

Takes milliseconds and returns a formatted duration.

Example

import { parse } from 'track-duration'

parse(5000000) // 1:23:19
parse(223452) // 3:43

Tests

npm test