cutlass exports an object with four classes: Script, Event, Style and Color. The one you usually want to deal with is Script, which represents a whole ASS script. (For more detailed info about the classes and the functions and properties they export, refer to src/parser.ls for the time being.)

var ass =require('cutlass');

var rawAss1 ="..."// pretend this is a full ASS script read from disk

var rawAss2 ="..."// this too

var script1 =newass.Script(rawAss1);

// sort the script by event start time

script1.sort();

// get the script as raw ASS

var rawScript1 = script1.toAss();

var script2 =newass.Script(rawAss2);

// for this script, we want to move all lines with the style "Sign" to the top.

// `script.events` is a plain JS array, so we can use them our purpose here.