You just need to use the evaluation API to load the contents of the script in the context. This is actually pretty close to what a browser does when it encounters a script tag.
NSURL *scriptURL = [NSURL URLWithString:@"path/to/fancyLibrary.js"];
NSError *error = nil;
NSString *script = [NSString stringWithContentsOfURL:scriptURL encoding:NSUTF8StringEncoding error:&error];
[context evaluateScript:script];