1.0.3 • Published 2 years ago

subtitle-merger v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Subtitle Merger

No dependencies subtitle merger.

:white_check_mark: SRT support

Installation

npm

$ npm i subtitle-merger

Usage

Example of merging subtitles.

import { merge } from "subtitle";

const subOne = `
1
00:00:00,498 --> 00:00:02,827
Hello, this is an example.

`;
const subTwo = `
1
00:00:00,498 --> 00:00:02,827
こんにちは。これはサンプルです。

`;

// it will return a Subtitle object.
const mergedSubtitle = merge(subOne, subTwo);

Getting the merged content as a text:

mergedSubtitle.content;

// Output:
// 1
// 00:00:00,498 --> 00:00:02,827
// Hello, this is an example.
// こんにちは。これはサンプルです。

Getting the merged content as a Blob:

mergedSubtitle.blob;