How to use the hibp.breaches function in hibp

To help you get started, we’ve selected a few hibp 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 wKovacs64 / pwned / src / api / getBreaches.js View on Github external
export default (domain, raw) => {
  if (!raw && process.stdout.isTTY) {
    spinner.start();
  }
  return Promise.resolve(breaches({ domain }))
    .then((breachData) => {
      if (!raw && process.stdout.isTTY) {
        spinner.stop(true);
      }
      if (breachData.length && raw) {
        logger.log(JSON.stringify(breachData));
      } else if (breachData.length) {
        logger.log(prettyjson.render(breachData));
      } else if (!breachData.length && !raw) {
        logger.log('No breaches found.');
      }
    })
    .catch((err) => {
      if (!raw && process.stdout.isTTY) {
        spinner.stop(true);
      }

hibp

An unofficial TypeScript SDK for the 'Have I been pwned?' service.

MIT
Latest version published 5 months ago

Package Health Score

74 / 100
Full package analysis