Stream-based library for parsing and manipulating subtitle files
parse
, stringify
and resync
are now stream-based functions)parseSync
and stringifySync
as synchronous version of parse
and stringify
map
and filter
to manipulate the parse stream"SRT"
and "WebVTT"
instead of "srt"
and "vtt"
parse(input: string): Caption[]
stringify(captions: Caption[], options?: { format: 'srt' | 'vtt }): string
resync(captions: Caption[], time: number): Caption[]
parseTimestamp(timestamp: string): number
parseTimestamps(timestamps: string): Timestamp
formatTimestamp(timestamp: number, options?: { format: 'srt' | 'vtt' }): string
parse
supports optional indexes