haveibeenpwned-checker
(https://badges.greenkeeper.io/mikeshaker/haveibeenpwned-checker.svg)](https://greenkeeper.io/)
Pwned Passwords check passwords, email addresses, and usernames if they have previously been exposed in data breaches. Using APIs by Troy Hunt (haveibeenpwned.com).
Demo
Installation
npm i haveibeenpwned-checker
Usage
const HIBP = ; ## Passwords// password : password string to check//// callback: callback method // timeout -(optional) by default it's 3000 ms integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request. HIBP; ##Accounts #Rate limiting: based on the rate limit by https://haveibeenpwned.com (one per every 1500 milliseconds each from any given IP address)// Account : email addres/username// callback: callback method // timeout -(optional) by default it's 3000 ms integer containing the number of milliseconds to wait for a server to send response headers (and start the response body) before aborting the request.HIBP; //Return Object// { error: string, failed: boolean, count: number }// error: error message if encounter an error.// success: boolean flag to indicate if call/api failed// count: count of how many times it appears in breaches.{ console; //{ error: '', success: true, count: 3645804 }} Mike Shaker