I can tell you the clunky way I did it for the Fountain parser.
I took the entire code for the fountain javascript library and put it in a tiddler:
$:/plugins/MAS/fountain/fountain.js
I marked it
type: application/javascript
module-type:
library
Inside the parser/wrapper I referred to the code like this:
var fountain = require("$:/plugins/MAS/fountain/fountain.js");
and was then able to use fountain.parse(text) directly (which was the only thing I needed from the code).
Perhaps someone can explain a better way of doing this -- particularly if you want to leave the library on the disk so it doesn't bloat your TW.
Good luck!
-- Mark
var fountain = require("$:/plugins/MAS/fountain/fountain.js");