@pietrop/timecode-converter

1.0.0 • Public • Published

timecode converter

A dependency free timecode-converter mode module utility. That can be used either client side or server side. Originally extracted form @bbc/react-transcript-editor/packages/util/timecode-converter, and original code domain logic from @bevand10 🙌

Why publish it as a standalone module?

The problem of exporting it from @bbc/react-transcript-editor or @pietrop/slate-transcript-editor is that, somehow it ends up expecting react as a peer dependency.

And besides that not being ideal, or good practice, not only it can cause problems with keeping up with react peer dependency of other modules, but also add that as a peer dependency to other module consuming it, such as @pietrop/edl-composer that doesn't really need any of that.

Setup

git clone git@github.com:pietrop/timecode-converter.git
cd timecode-converter
npm install

Usage

Some example, see the test files more more

import { secondsToTimecode, timecodeToSeconds, shortTimecode } from "@pietrop/ timecode-converter";

const result1 = secondsToTimecode(600);
// '00:10:00:00'

const result2 = timecodeToSeconds( '00:10:00:00');
// 600

const result3 = shortTimecode(0)
// '00:00:00'

const result4 = shortTimecode( '00:10:00:00')
//  '00:10:00'

System Architecture

A node module

Development env

How to run the development environment -->

Node version is set in node version manager .nvmrc

nvm use

Build

NA

Tests

npm run test

see Jest & ECMAScript Modules in their docs, for more info.

Deployment

To publish to npm

npm run publish:public

and for pre-flight checks 🔦🛫

npm run publish:dry:run

Readme

Keywords

none

Package Sidebar

Install

npm i @pietrop/timecode-converter

Weekly Downloads

171

Version

1.0.0

License

ISC

Unpacked Size

8.51 kB

Total Files

6

Last publish

Collaborators

  • pietrop