How to use the hibp.dataClasses 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 / getDataClasses.js View on Github external
export default (raw) => {
  if (!raw && process.stdout.isTTY) {
    spinner.start();
  }
  return Promise.resolve(getDataClasses())
    .then((dataClasses) => {
      if (!raw && process.stdout.isTTY) {
        spinner.stop(true);
      }
      if (dataClasses.length && raw) {
        logger.log(JSON.stringify(dataClasses));
      } else if (dataClasses.length) {
        logger.log(prettyjson.render(dataClasses));
      } else if (!dataClasses.length && !raw) {
        logger.log(
          'No data classes found. This is unexpected - the remote API may be ' +
            'having difficulties.',
        );
      }
    })
    .catch((err) => {

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