Let's you stream decode srt files - gives you back a json string with the id, start, end and the dialogs. The start and end time are in milliseconds.
npm install srt-stream-parser --save-dev
var srt = require('srt-stream-parser');
var srt_file = fs.createReadStream('./path/to/your/file.srt');
var subutitles = [];
file.pipe(srt()).on('data', function(data) {
var data = JSON.parse(data);
subutitles.push(data);
}).on('end', function () {
console.log('All done, parsed: ' + subutitles.length + ' subtitles');
});
Where in the single data entry concists of:
{
"id": "1337",
"start": 56880000,
"end": 57060000,
"dialogs": ["A world without rules and controls,", "without borders or boundaries."]
}