srt-stream
A read/write stream for srt subtitles
Note: This package is written in ES6 and as is, it will only work with nodejs versions 6 and higher.
Install
npm install srt-stream
Usage
Append a line to every subtitle and write to new file
const fs =const srt =const through =fs
By default invalid subs are ignored.
read
takes onInvalid (sub)
callback in which you can return a sub object and it will get pushed through the stream.
Push invalid subs through
const fs =const srt =fs
Subtitle object example
id: 1startTime:hours: 0minutes: 0seconds: 5ms: 532startTime:hours: 0minutes: 0seconds: 9ms: 234body: 'first line' 'second line'
License
MIT. Copyright (c) Krešimir Klas