Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 778 Bytes

README.md

File metadata and controls

55 lines (38 loc) · 778 Bytes

Subtitle Merger

No dependencies subtitle merger.

✅ 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;