ass-stringify
Stringify ass-parser parse tree to plain SSA/ASS subtitle format. Forked from eush77/ass-stringify.
Changes:
- All dependencies replaced with native modern JavaScript functions.
- ES Modules instead of CommonJS.
- Added options.
- Format numeric timestamps.
Demo
https://codepen.io/qgustavor/full/YzaRXeX
API
assStringify(ass, options)
Returns a text string. See the demo or test/sample.ass
for an example.
Options is an object with the following keys:
-
lineBreak
: defaults to\n
, set to\r\n
to use Windows' line breaks -
formatJoiner
: defaults to,
, some subtitles use,
instead -
sectionJoiner
: defaults tolineBreak
repeated twice -
timestampKeys
: defaults to['Start', 'End']
, defines which keys can be formatted to timestamps when numbers are provided
References
Related
- @qgustavor/ass-parser - SSA/ASS parser.
Install
npm install @qgustavor/ass-stringify
License
MIT