0.3.1 • Published 3 years ago
@qgustavor/ass-stringify v0.3.1
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\nto use Windows' line breaksformatJoiner: defaults to,, some subtitles use,insteadsectionJoiner: defaults tolineBreakrepeated twicetimestampKeys: 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-stringifyLicense
MIT