
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
ass-compiler
Advanced tools
Parses and compiles ASS subtitle format to easy-to-use data structure.
Parses and compiles ASS subtitle format to easy-to-use data structure.
npm install ass-compiler
You can use parse
or compile
as your need.
import { parse, stringify, compile, decompile } from 'ass-compiler';
// ASS file content
const text = `
[Script Info]
; ...
`;
// parse just turn ASS text into JSON
const parsedASS = parse(text);
const stringifiedText = stringify(parsedASS);
// compile will get rid of invalid tags, merge duplicated tags, transform drawings, etc.
const compiledASS = compile(text, options);
const decompiledText = decompile(compiledASS);
{
// Used for default values if it's not in `[Script Info]` section.
defaultInfo: {
PlayResX: 1280,
PlayResY: 720,
},
// 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.
FAQs
Parses and compiles ASS subtitle format to easy-to-use data structure.
The npm package ass-compiler receives a total of 1,174 weekly downloads. As such, ass-compiler popularity was classified as popular.
We found that ass-compiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.