JSPM

@splayer/ass-compiler

0.0.11-dev.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q22086F
  • License MIT

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

Package Exports

  • @splayer/ass-compiler

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@splayer/ass-compiler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ass-compiler

Build status Coverage Dependencies NPM version License File size jsDelivr

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

Online Viewer

Installation

npm install ass-compiler

Usage

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

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.