Parse SSA/ASS subtitle format. Forked from eush77/ass-parser.
- All dependencies replaced with native modern JavaScript functions.
- ES Modules instead of CommonJS.
https://codepen.io/qgustavor/full/YzaRXeX
Returns the parse tree.
Comments are ignored unless options.comments
is set.
Option | Type | Required? | Default |
---|---|---|---|
comments | boolean | No | false |
Subtitle is a list of sections, each of them has section
and body
properties. The body
is a list of key-value bindings (descriptors), with key
and value
properties (type === 'comment'
and value
for comments).
value
can be one of the following:
- array if the descriptor key is
"Format"
; - object if there is a
"Format"
descriptor above in the section; - string otherwise.
- @qgustavor/ass-stringify - stringify SSA/ASS parse tree.
npm install @qgustavor/ass-parser
MIT