bind-generator Change the scope of a generator function let bindGenerator = require("bind-generator"); let scopedGenerator = bindGenerator(instance, instance.myGeneratorFunction); yield scopedGenerator();