Skip to content
Parses and compiles ASS subtitle format to easy-to-use data structure
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist 0.0.10 Nov 14, 2018
test support long integer colors, #2 Nov 14, 2018
.eslintrc.json update lint rules Sep 13, 2017
.gitignore add buble to use ES6 Sep 2, 2017
.npmrc improve performance of parsing tags Dec 2, 2017
.travis.yml update lint rules Sep 9, 2017
LICENSE initial commit May 30, 2017
package.json 0.0.10 Nov 14, 2018
rollup.config.js more tolerant to parse drawing commands Apr 5, 2018
rollup.config.test.js avoid ReDoS Nov 18, 2017


Build status Coverage Dependencies NPM version License

Parses and compiles ASS subtitle format to easy-to-use data structure.

Online Viewer


npm install ass-compiler


import { parse, compile } from 'ass-compiler';
compile(text, options);


  // A Style named `Default` will be automatic generated by options.defaultStyle
  // if it is not exists in `[V4+ Style]` section.
  defaultStyle: {
    Name: 'Default',
    Fontname: 'Arial',
    Fontsize: '20',
    PrimaryColour: '&H00FFFFFF&',
    SecondaryColour: '&H000000FF&',
    OutlineColour: '&H00000000&',
    BackColour: '&H00000000&',
    Bold: '0',
    Italic: '0',
    Underline: '0',
    StrikeOut: '0',
    ScaleX: '100',
    ScaleY: '100',
    Spacing: '0',
    Angle: '0',
    BorderStyle: '1',
    Outline: '2',
    Shadow: '2',
    Alignment: '2',
    MarginL: '10',
    MarginR: '10',
    MarginV: '10',
    Encoding: '1',

For details of data structure, please use the online viewer.

You can’t perform that action at this time.