How to use the deasync.roo function in deasync

To help you get started, we’ve selected a few deasync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sentialx / node-window-manager / src / macos.ts View on Github external
callSync(cmd: string) {
    p.stdin.write(`${cmd}\n`);

    let data: string;

    p.stdout.once("data", d => {
      data = d.toString();
    });

    while (!data) deasync.roo;
    deasync.loopWhile(() => !data);

    return data;
  }

deasync

Turns async function into sync via JavaScript wrapper of Node event loop

MIT
Latest version published 7 months ago

Package Health Score

69 / 100
Full package analysis