@johnny.reina/convert-srt
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

SRT Converter npm (scoped)

Convert .srt subtitle files to JavaScript objects

Installing

npm i @johnny.reina/convert-srt

Usage

toSrt(srt: string): Array<Subtitle>

The main export of this package. Accepts the string contents of a .srt file and returns an array of Subtitle objects.

toWebVTT(subs: Array<Subtitle>): string

Accepts an array of Subtitle objects and returns a WebVTT string.

Subtitle

interface Subtitle {
    index: number;
    from: string;
    to: string;
    text: string;
}

Readme

Keywords

Package Sidebar

Install

npm i @johnny.reina/convert-srt

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

8.38 kB

Total Files

12

Last publish

Collaborators

  • johnny.reina