JSPM

  • Created
  • Published
  • Downloads 24896
  • Score
    100M100P100Q134204F
  • License MIT

Parse and manipulate SRT (SubRip)

Package Exports

  • subtitle

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (subtitle) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

subtitle.js

Parse and manipulate SRT (SubRip) format.

Installing

npm install subtitle --save

Usage

var Subtitle = require('subtitle');

var subtitle = new Subtitle('your srt here');

console.log(subtitle.parse());

It's gonna return an array like this:

[
  {
    index: 1,
    start: '00:00:20,000',
    end: '00:00:24,400',
    text: 'Bla Bla Bla Bla'
  },
  {
    index: 2,
    start: '00:00:24,600',
    end: '00:00:27,800',
    text: 'Bla Bla Bla Bla'
  }
]

Tests

npm test

Roadmap

  • Basic SRT parser
  • Basic manipulation
  • Stringfy
  • Time conversion
  • Duration property
  • WebVTT support
  • Browser support (including for Browserify)
  • Better docs