How to use the get-stdin.then function in get-stdin

To help you get started, we’ve selected a few get-stdin 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 Jam3 / devtool / test / fixtures / stdin.js View on Github external
require('get-stdin')()
  .then(function (data) {
    process.stdout.write(data.toString(), function () {
      window.close();
    });
  })
  .catch(function (err) {
    process.stdout.write(err.message + '\n', function () {
      process.exit(1);
    });
  });
github shinnn / node-flex-svg / cli.js View on Github external
console.log(result);
    }
  });
}

if (process.stdin.isTTY) {
  if (argv._.length === 0 && argv.input === undefined || argv.help) {
    yargs.showHelp('log');
  } else if (argv.input) {
    const fs = require('fs');
    run(fs.readFileSync(argv.input, 'utf8').replace(/^\ufeff/g, ''));
  } else {
    run(argv._[0]);
  }
} else {
  require('get-stdin')().then(run);
}

get-stdin

Get stdin as a string or buffer

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis

Popular get-stdin functions