vtt-to-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

vtt-to-text

A module to convert vtt (WebVTT) to plain text.

Installation

npm i -S vtt-to-text
# or use yarn
yarn add vtt-to-text

Example

Input:

captions:  WEBVTT
Kind: captions
Language: en

00:00:00.160 --> 00:00:03.270 align:start position:0%
 
all<00:00:00.240><c> right</c><00:00:00.640><c> last</c><00:00:01.599><c> apple</c><00:00:02.159><c> story</c><00:00:02.560><c> of</c><00:00:02.639><c> the</c><00:00:02.800><c> day</c>

00:00:03.270 --> 00:00:03.280 align:start position:0%
all right last apple story of the day

Output:

all right last apple story of the day

Usage

const {vttToPlainText} = require("vtt-to-text")

const captionVtt1 = `
captions:  WEBVTT
Kind: captions
Language: en

00:00:00.160 --> 00:00:03.270 align:start position:0%
all<00:00:00.240><c> right</c><00:00:00.640><c> last</c><00:00:01.599><c> apple</c><00:00:02.159><c> story</c><00:00:02.560><c> of</c><00:00:02.639><c> the</c><00:00:02.800><c> day</c>
`

let a = vttToPlainText(captionVtt1);
console.log(a);

Package Sidebar

Install

npm i vtt-to-text

Weekly Downloads

33

Version

1.0.1

License

MIT

Unpacked Size

3.63 kB

Total Files

6

Last publish

Collaborators

  • sabbaken