{"id":19994193,"url":"https://github.com/b4dnewz/node-pwned","last_synced_at":"2025-05-04T13:30:53.690Z","repository":{"id":57332139,"uuid":"107119031","full_name":"b4dnewz/node-pwned","owner":"b4dnewz","description":"A very simple javascript client for HaveIBeenPwned API.","archived":false,"fork":false,"pushed_at":"2019-01-31T09:59:00.000Z","size":754,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T01:46:34.999Z","etag":null,"topics":["haveibeenpwned","javascript-client"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b4dnewz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-16T11:34:37.000Z","updated_at":"2022-01-11T03:01:00.000Z","dependencies_parsed_at":"2022-09-13T13:42:59.037Z","dependency_job_id":null,"html_url":"https://github.com/b4dnewz/node-pwned","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4dnewz%2Fnode-pwned","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4dnewz%2Fnode-pwned/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4dnewz%2Fnode-pwned/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4dnewz%2Fnode-pwned/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b4dnewz","download_url":"https://codeload.github.com/b4dnewz/node-pwned/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252341193,"owners_count":21732467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haveibeenpwned","javascript-client"],"created_at":"2024-11-13T04:54:18.267Z","updated_at":"2025-05-04T13:30:53.370Z","avatar_url":"https://github.com/b4dnewz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pwned-api\n\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]\n\n\u003e Unofficial javascript client for HaveIBeenPwned API\n\n## Installation\n\nYou can use it as a nodejs module:\n\n```\nnpm install --save pwned-api\n```\n\nOr also install it globally and use it as cli tool:\n\n```\nnpm install --global pwned-api\n```\n\n## Usage\n\nLoad 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.\n\n```js\nconst Pwned = require('pwned-api');\nconst pwner = new Pwned();\n\npwner.breaches({}, (err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\nUsing new __await/async__ functionalities:\n\n```js\nimport Pwned from 'pwned-api'\nconst pwner = new Pwned();\n\n(async () =\u003e {\n  const res = await pwner.breaches();\n  // Do whatever you need to do\n})()\n```\n\nThe pwner constructor takes two arguments, so you can customize the requests beheviour:\n\n```js\nconst pwner = new Pwned({\n  timeout: 2500,\n  headers: {\n    'User-Agent': 'My App'\n  }\n});\n```\n\n---\n\n## Methods\n\n#### breaches\n\nList all the available breaches\n\n```js\npwner.breaches({}, (err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\n#### breachedAccount\n\nReturn a list of all breaches a particular account has been involved in.\n\n```js\npwner.breachedAccount('john.doe@example.com', {}, (err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\n#### breach\n\nReturn single breach retrieved by the breach \"name\".\n\n```js\npwner.breach('AshleyMadison', (err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\n#### dataClasses\n\nReturn all the data classes in the system.\n\n```js\npwner.dataClasses((err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\n#### pasteAccount\n\nReturn all pastes for an account, takes a single parameter which is the email address to be searched for.\n\n```js\npwner.pasteAccount('john.doe@example.com', (err, results) =\u003e {\n  console.log('Results:', results);\n});\n```\n\n#### pwnedPassword\n\nCheck if a password been exposed in data breaches and exists on HIBP database.\n\n```js\npwner.pwnedPassword('admin1234', {}, (err) =\u003e {\n  console.log('Error;', err );\n});\n```\n\nFor details in depth about the API please consult the official [HaveIBeenPwned](https://haveibeenpwned.com/API/v2) page.\n\n---\n\n## License\n\nMIT © b4dnewz\n\n\n[npm-image]: https://badge.fury.io/js/pwned-api.svg\n[npm-url]: https://npmjs.org/package/pwned-api\n[travis-image]: https://travis-ci.org/b4dnewz/node-pwned.svg?branch=master\n[travis-url]: https://travis-ci.org/b4dnewz/node-pwned\n[daviddm-image]: https://david-dm.org/b4dnewz/node-pwned.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/b4dnewz/node-pwned\n[coveralls-image]: https://coveralls.io/repos/b4dnewz/node-pwned/badge.svg\n[coveralls-url]: https://coveralls.io/r/b4dnewz/node-pwned\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb4dnewz%2Fnode-pwned","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb4dnewz%2Fnode-pwned","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb4dnewz%2Fnode-pwned/lists"}