Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ass-styles

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ass-styles

Extract styles from SSA/ASS subtitles, edit & save back

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

npm

ass-styles

Build Status Dependency Status

Extract styles from SSA/ASS subtitles, edit & save back.

Example

var parse = require('ass-parser');
var getStyles = require('ass-restyler');
var stringify = require('ass-stringify');

var subtitle = fs.readFileSync('subtitle.ass', { encoding: 'utf8' });
var ass = parse(subtitle, { comments: true });
var styles = getStyles(ass);

styles.Default.MarginV = 335;
styles.Default.Fontsize = Number(restyler.Default.Fontsize) + 10;

console.log(stringify(ass));

API

styles = assStyles(ass)

ass - subtitle in the ass-parser format.

Returns the object containing all the styles from all the styling sections.

styles[style] references the original parse tree node, so editing is fully supported.

styles[style][attribute] is a value of the attribute in the specific style. It is usually a string and should always be expected to be a string.

However, you can't add a new style or erase an existing one, but why would you?

References

Install

npm install ass-styles

License

MIT

Keywords

FAQs

Package last updated on 19 May 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc