pwned-api
Unofficial javascript client for HaveIBeenPwned API
Installation
You can use it as a nodejs module:
npm install --save pwned-api
Or also install it globally and use it as cli tool:
npm install --global pwned-api
Usage
Load the pwned-api module into your script than init the class to use its methods. It accept a callback but also return a promise so you can use it also with async.
const Pwned = ;const pwner = ; pwner;
Using new await/async functionalities:
const pwner = ; async { const res = await pwner; // Do whatever you need to do}
The pwner constructor takes two arguments, so you can customize the requests beheviour:
const pwner = timeout: 2500 headers: 'User-Agent': 'My App' ;
Methods
breaches
List all the available breaches
pwner;
breachedAccount
Return a list of all breaches a particular account has been involved in.
pwner;
breach
Return single breach retrieved by the breach "name".
pwner;
dataClasses
Return all the data classes in the system.
pwner;
pasteAccount
Return all pastes for an account, takes a single parameter which is the email address to be searched for.
pwner;
pwnedPassword
Check if a password been exposed in data breaches and exists on HIBP database.
pwner;
For details in depth about the API please consult the official HaveIBeenPwned page.
License
MIT © b4dnewz