@qgustavor/ass-stringify

0.3.1 • Public • Published

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 to lineBreak repeated twice
  • timestampKeys: defaults to ['Start', 'End'], defines which keys can be formatted to timestamps when numbers are provided

References

Related

Install

npm install @qgustavor/ass-stringify

License

MIT

Package Sidebar

Install

npm i @qgustavor/ass-stringify

Weekly Downloads

1

Version

0.3.1

License

MIT

Unpacked Size

5.03 kB

Total Files

4

Last publish

Collaborators

  • qgustavor