How to use the noflo.isBrowser function in noflo

To help you get started, we’ve selected a few noflo 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 noflo / noflo-core / components / ReadGlobal.js View on Github external
return c.process((input, output) => {
    if (!input.hasData('name')) { return; }
    const data = input.getData('name');

    const value = !noflo.isBrowser() ? global[data] : window[data];

    if (typeof value === 'undefined') {
      const err = new Error(`"${data}" is undefined on the global object.`);
      output.sendDone(err);
      return;
    }
    output.sendDone({ value });
  });
};

noflo

Flow-Based Programming environment for JavaScript

MIT
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis