https://github.com/ianmitchell/aegisub-parser
Parses Aegisub files
https://github.com/ianmitchell/aegisub-parser
Last synced: about 1 year ago
JSON representation
Parses Aegisub files
- Host: GitHub
- URL: https://github.com/ianmitchell/aegisub-parser
- Owner: IanMitchell
- Created: 2016-12-12T04:12:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-23T21:28:41.000Z (over 9 years ago)
- Last Synced: 2025-03-01T18:38:22.890Z (over 1 year ago)
- Language: JavaScript
- Size: 447 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Aegisub Parser
Parses [Aegisub](http://www.aegisub.org/) files (.ass). Easily extensible for past/future sections.
## Installation
```
npm install aegisub-parser --save
```
## Usage
```javascript
const AegisubParser = require('aegisub-parser');
AegisubParser.parse('./full_metal_panic_01.ass').then(script => {
console.log(script.events.length);
}).catch(err) {
if (err instanceof AegisubInvalidStyle) {
console.log('Please validate your Aegisub styles.');
} else if (err instanceof AegisubInvalidEvent) {
console.log('Please validate your Aegisub events.');
}
};
```
This returns an `AegisubScript` object, which given a standard v4 file looks like the following:
* **AegisubScript** Properties
* `info` (Map): Map of info section key/value pairs.
* `garbage` (Map): Map of garbage section key/value pairs.
* `styles` (Map): Map of styles in name/Map pairs.
* `events` (Array): Array of Map objects in sequential order.
## Special Thanks
Toby, Matthias, and Good Job Media! for design assistance and spec clarification.
Test files pulled from Vivid and Good Job Media! GitHub Repositories.