var moment = require('moment'); var config = (s, e) => { var day = moment().day(); if (day < 20) { s('ok'); } else { e('not'); } } var test = function *() { yield; }; console.log(test);