typescript-timecode
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

typscript-timecode

A typscript tool to convert timecodes

GitHub Workflow Status GitHub repo size GitHub

Installation

For npm users:

npm install typescript-timecode

For yarn users:

yarn add typescript-timecode
import Timecode from "typescript-timecode";

// To convert millisecond to standard time code
const t1 = Timecode.MillisecondsToTime(320009); // t1 = "05:20";
//if need ms then pass separator
const t2 = Timecode.MillisecondsToTime(320009, "."); // t2 = "05:20.009";

// To convert millisecond to HH:MM:ss time code
const t3 = Timecode.MillisecondsToHHMMss(320009); // t3 = "00:05:20";

// To convert millisecond to HH:MM:ss.SSS time code
const t4 = Timecode.MillisecondsToHHMMssSSS(320009); // t4 = "00:05:20.009";

// To convert millisecond to HH:MM:ss.SSS time code
const t5 = Timecode.MillisecondsToHHMMssSSS(320009, ","); // t5 = "00:05:20,009";

// To convert millisecond to HH:MM:ss.SSS time code
const t6 = Timecode.MillisecondsToHHMMssSSS(320009, ":"); // t6 = "00:05:20:009";

// To convert a standard time code, HHMMss, and HHMMssSSS to milliseconds.
const ms1 = Timecode.TimetoMilliseconds("00:00:03.09"); // ms1 = 3009;

Tests

To run them, just do:

npm run test

Contributing

Any is welcomed. Just open a PR.

Package Sidebar

Install

npm i typescript-timecode

Weekly Downloads

6

Version

0.0.5

License

MIT

Unpacked Size

16.2 kB

Total Files

14

Last publish

Collaborators

  • ijazulrehman