New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

subtitle-utils

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subtitle-utils

Simple subtitle utils.

latest
Source
npmnpm
Version
1.2.3
Version published
Maintainers
1
Created
Source

subtitle-utils

A simple utils for subtitle such as SRT, WebVTT.

Build Status codecov

Example

const Subtitle = require('subtitle-utils');

const exampleSRT = `
  1
  00:02:17,440 --> 00:02:20,375
  Senator, we're making
  our final approach into Coruscant.

  2
  00:02:20,476 --> 00:02:22,501
  Very good, Lieutenant.

`;

Subtitle.fromSRT(exampleSRT).toVTT();
  

Installation

npm install subtitle-utils

API

static Subtitle.fromSRT(data: string): Subtitle

Create a Subtitle instance from SubRip SRT subtitle.

static Subtitle.fromVTT(data: string): Subtitle

Create a Subtitle instance from WebVTT subtitle.

Subtitle.subtitles: ISubtitle[]

Get array of subtitle object.

Subtitle.toSRT(data: string): string

Returns SubRip SRT subtitle value.

Subtitle.toVTT(data: string): string

Returns WebVTT subtitle value;

Keywords

subtitle

FAQs

Package last updated on 13 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts