Make generator script runnable from a require