@babel/plugin-proposal-function-sent

    1. const _functionSent = yield;
    2. console.log("Sent", _functionSent);
    3. console.log("Yield", yield);
    4. });
    5. const iterator = generator();
    6. iterator.next(1); // Logs "Sent 1"
    1. {
    2. }
    1. require("@babel/core").transformSync("code", {
    2. plugins: ["@babel/plugin-proposal-function-sent"],
    3. });