{"id":16532647,"url":"https://github.com/hamedfathi/passwordmeter","last_synced_at":"2025-03-16T19:31:46.228Z","repository":{"id":27096105,"uuid":"112462088","full_name":"HamedFathi/PasswordMeter","owner":"HamedFathi","description":"This password meter is based on a point system. Its main goal is to help the end-user with a stronger password.","archived":false,"fork":false,"pushed_at":"2024-03-17T17:49:32.000Z","size":499,"stargazers_count":22,"open_issues_count":4,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T18:13:37.239Z","etag":null,"topics":["javascript","meter","metering","nodejs","password","password-meter","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/HamedFathi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"HamedFathi","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2017-11-29T10:36:49.000Z","updated_at":"2024-09-20T13:30:51.000Z","dependencies_parsed_at":"2023-01-14T05:58:41.323Z","dependency_job_id":"33129886-9eb0-4b34-be6c-ca40383380f6","html_url":"https://github.com/HamedFathi/PasswordMeter","commit_stats":{"total_commits":60,"total_committers":6,"mean_commits":10.0,"dds":0.6,"last_synced_commit":"6063f3e74f7aa6250c81689ddfd97abf99c8d5f3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedFathi%2FPasswordMeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedFathi%2FPasswordMeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedFathi%2FPasswordMeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HamedFathi%2FPasswordMeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HamedFathi","download_url":"https://codeload.github.com/HamedFathi/PasswordMeter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221667317,"owners_count":16860595,"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":["javascript","meter","metering","nodejs","password","password-meter","typescript"],"created_at":"2024-10-11T18:13:08.092Z","updated_at":"2024-10-27T11:09:45.158Z","avatar_url":"https://github.com/HamedFathi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/HamedFathi"],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT] \n\u003e Introducing **HamedStack**! For all my latest libraries, visit: [Explore HamedStack](https://github.com/HamedStack). Replacements and updates are available at the link. Thank you for your support! The new version of this library is accessible via [HamedStack.PasswordMeter](https://github.com/HamedStack/HamedStack.PasswordMeter)\n---\n\n\n![password](https://user-images.githubusercontent.com/8418700/140722813-db8b8cdb-9f97-4710-aff4-14450264bf82.png)\n\n# PasswordMeter \n\nThis password meter library is inspired by pointing system in [here](http://www.passwordmeter.com/), in which the main purpose is to help the end users to have more stronger passwords.\n\n[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://opensource.org/licenses/MIT)\n[![npm version](https://badge.fury.io/js/password-meter.svg)](https://badge.fury.io/js/password-meter)\n[![Downloads](https://img.shields.io/npm/dm/password-meter.svg)](https://www.npmjs.com/package/password-meter)\n\n```\nnpm i password-meter\n\nyarn add password-meter\n```\n\n```javascript\n\n// default\nconsole.log(JSON.stringify(new PasswordMeter().getResult('@xc5--WWb')));\n// result\n{\n\t\"score\" : 170,\n\t\"status\" : \"strong\",\n\t\"percent\" : 85\n}\n\n\n// with score range\nconsole.log(JSON.stringify(new PasswordMeter({}, {\n    \"40\": \"E\",  // 001 \u003c= x \u003c  040\n    \"80\": \"D\",  // 040 \u003c= x \u003c  080\n    \"120\": \"C\", // 080 \u003c= x \u003c  120\n    \"180\": \"B\", // 120 \u003c= x \u003c  180\n    \"200\": \"A\", // 180 \u003c= x \u003c  200\n    \"_\": \"A+\"   //        x \u003e= 200\n}).getResult('@xc5--WWb')));\n// result\n{\n\t\"score\" : 170,\n\t\"status\" : \"B\",\n\t\"percent\" : 85\n}\n\n// with score range (The score range must have at least two members)\nconsole.log(JSON.stringify(new PasswordMeter({}, {\n    \"100\": \"Low\",  // 001 \u003c= x \u003c  100\n    \"_\": \"High\"    //        x \u003e= 100\n}).getResult('@xc5--WWb')));\n// result\n{\n\t\"score\" : 170,\n\t\"status\" : \"High\",\n\t\"percent\" : 100\n}\n\n// with requirements and score range\nconsole.log(JSON.stringify(new PasswordMeter({\n    minLength: 5,\n    maxLength: 10,\n    uppercaseLettersMinLength: 1,\n    lowercaseLettersMinLength: 2,\n    numbersMinLength: 1,\n    symbolsMinLength: 1,\n    include: ['a', '$'],\n    exclude: ['1baA$', '0xaZ$'],\n    startsWith: '1',\n    endsWith: '$',\n    includeOne: ['$']\n}, {\n        \"40\": \"veryWeak\",    // 001 \u003c= x \u003c  040\n        \"80\": \"weak\",        // 040 \u003c= x \u003c  080\n        \"120\": \"medium\",     // 080 \u003c= x \u003c  120\n        \"180\": \"strong\",     // 120 \u003c= x \u003c  180\n        \"200\": \"veryStrong\", // 180 \u003c= x \u003c  200\n        \"_\": \"perfect\"       //        x \u003e= 200\n    }).getResults(['1baAe$', '0xaZ$', 'ERT', '1pwQvF@87$','12a4A6rx90$'])));\n// result\n[{\n\t\t\"score\" : 118,\n\t\t\"status\" : \"medium\",\n\t\t\"percent\" : 59\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"The password must start with 1.\", \"The Password must exclude all the items specified.\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"The minimum password length is 5.\", \"The password must start with 1.\", \"The password must end with $.\", \"You must use at least 1 lowercase letter(s).\", \"You must use at least 1 number(s).\", \"You must use at least 1 symbol(s).\", \"The Password must include all the items specified.\", \"The Password must include at least one item specified [$].\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"The Password must include all the items specified.\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"The maximum password length is 10.\"],\n\t\t\"percent\" : 0\n\t}\n]    \n    \n\n// with requirements and score range and custom messages\nconsole.log(JSON.stringify(new PasswordMeter({\n    minLength: { value: 5, message: \"Hey!, check minLength\" },\n    maxLength: { value: 10, message: \"Hey!, check maxLength\" },\n    uppercaseLettersMinLength: { value: 1, message: \"Hey!, check uppercaseLettersMinLength\" },\n    lowercaseLettersMinLength: { value: 2, message: \"Hey!, check lowercaseLettersMinLength\" },\n    numbersMinLength: { value: 1, message: \"Hey!, check numbersMinLength\" },\n    symbolsMinLength: { value: 1, message: \"Hey!, check symbolsMinLength\" },\n    include: { value: ['a', '$'], message: \"Hey!, check include(s)\" },\n    exclude: { value: ['1baA$', '0xaZ$'], message: \"Hey!, check exclude(s)\" },\n    startsWith: { value: '1', message: \"Hey!, check startsWith\" },\n    endsWith: { value: '$', message: \"Hey!, check endsWith\" },\n    includeOne: { value: ['$'], message: \"Hey!, check includeOne\" }\n}, {\n        \"40\": \"veryWeak\",    // 001 \u003c= x \u003c  040\n        \"80\": \"weak\",        // 040 \u003c= x \u003c  080\n        \"120\": \"medium\",     // 080 \u003c= x \u003c  120\n        \"180\": \"strong\",     // 120 \u003c= x \u003c  180\n        \"200\": \"veryStrong\", // 180 \u003c= x \u003c  200\n        \"_\": \"perfect\"       //        x \u003e= 200\n    }).getResults(['1baAe$', '0xaZ$', 'ERT', '1pwQvF@87$','12a4A6rx90$'])));\n// result\n[{\n\t\t\"score\" : 118,\n\t\t\"status\" : \"medium\",\n\t\t\"percent\" : 59\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"Hey!, check startsWith\", \"Hey!, check exclude(s)\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"Hey!, check minLength\", \"Hey!, check startsWith\", \"Hey!, check endsWith\", \"Hey!, check lowercaseLettersMinLength\", \"Hey!, check numbersMinLength\", \"Hey!, check symbolsMinLength\", \"Hey!, check include(s)\", \"Hey!, check includeOne\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"Hey!, check include(s)\"],\n\t\t\"percent\" : 0\n\t}, {\n\t\t\"score\" : -1,\n\t\t\"status\" : \"needs requirement(s)\",\n\t\t\"errors\" : [\"Hey!, check maxLength\"],\n\t\t\"percent\" : 0\n\t}\n]    \n```\n\n\u003chr/\u003e\n\n### Release notes\n\n##### Version 3.10.1\n\nAdding `exports` block to `package.json` to support `.cjs` and `.mjs`.\n\nAll dependencies upddated.\n\n##### Version 3.9.3\n\n`System.js` module format added.\n\nAll dependencies upddated.\n\n##### Version 3.9.2\n\nFor `unpkg`, the minified `UMD` package was set.\n\nFix bundle's name issue.\n\nNow, you can use the library inside a browser as well as the Node.js.\n\n```js\n// IIFE\n// https://unpkg.com/password-meter@VERSION/dist/index.iife.js\n// https://unpkg.com/password-meter@3.9.3/dist/index.iife.js\n// https://unpkg.com/password-meter@3.9.3/dist/index.iife.min.js\n\nvar pswm = new PasswordMeterModule.PasswordMeter();\nvar result = pswm.getResult(\"pa$$w0rd\");\n```\n\nand also,\n\n```js\n// UMD\n// https://unpkg.com/password-meter@VERSION/dist/index.umd.js\n// https://unpkg.com/password-meter\n// https://unpkg.com/password-meter@3.9.3/dist/index.umd.js\n// https://unpkg.com/password-meter@3.9.3/dist/index.umd.min.js\n\nvar pswm = new PasswordMeterModule.PasswordMeter();\nvar result = pswm.getResult(\"pa$$w0rd\");\n```\n\n##### Version 3.8.1\n\nFix a bug for `UMD` module name.\n\n##### Version 3.8\n\nNo new feature or breaking changes just changing in project structure. (From `Gulp` to `Rollup`)\n\n##### Version 3.7\n\nIn `getResult(password: string, ignoreCase: boolean = false, skipReq: boolean = false))` `skipReq` was added.\nWith this option we could provide a \"score\" to our users based on the current \ntyped password (even if they aren't according to requirements).\n\n```typescript\nconsole.log(JSON.stringify(new PasswordMeter({ \n    uniqueLettersMinLength: { value: 5, message: \"Hey!, check uniqMinLength\" } \n  }).getResult('aZ\u00264aZ\u00264', false, true)));\n// result\n{\"score\":124,\"status\":\"strong\",\"percent\":62,\"errors\":[\"Hey!, check uniqMinLength\"]}\n```\n\n##### Version 3.6\n\n`includeOne` added.\nNow you can define custom special characters set.\n\n```typescript\nconsole.log(JSON.stringify(new PasswordMeter({\n\t\tincludeOne: { value: [\"#\", \"!\", \"*\"], message: \"Hey!, check includeOne\" },\n\t}).getResult('aZ\u00264aZ\u00264')));\n// result\n{\"score\":-1,\"status\":\"needs requirement(s)\",\"errors\":[\"Hey!, check includeOne\"],\"percent\":0}\n```\nThey are looking for including at least one character from provided set, but `aZ\u00264aZ\u00264` has none of them!\n\n\n##### Version 3.5\n\nbug fixed: `uniqueLettersMinLength` is optional now.\n\n##### Version 3.4\n\n`uniqueLettersMinLength` added.\nNow you can define min length for unique letters.\n\n```typescript\nconsole.log(JSON.stringify(new PasswordMeter({\n\t\tuniqueLettersMinLength: { value: 5, message: \"Hey!, check uniqMinLength\" },\n\t}).getResult('aZ\u00264aZ\u00264')));\n// result\n{\"score\":-1,\"status\":\"needs requirement(s)\",\"errors\":[\"Hey!, check uniqMinLength\"],\"percent\":0}\n```\nThey are looking for `5` unique characters but `aZ\u00264aZ\u00264` needs one more!\n\n##### Version 3.3\n\n```\nEverything except letters (a-z and A-Z) and numbers (0-9) are considered symbols, \nso the symbols are not defined in advance.\n```\n\n##### Version 3.2\n\n```\nAn 'ignoreCase' mode is added in .getResult('',ignoreCase: boolean = false)) \nand also for .getResults([],ignoreCase: boolean = false)) as a parameter.\n\nObviously, the default value is 'false', It helps you to 'exclude' and 'blackList' passwords in an easier way\nif you pass the 'true' then exclude: { value: ['test'], message: \"Hey!, check exclude(s)\" }, \nmeans every kind of 'test' word for example teST, TEST, Test eESt and so on are excluded.\n\n```\n\n##### Version 3.1\n\n```\n- blackList property added. eg: { blackList : ['123456','p@ssw0rd'] }\n```\n\n##### Version 3.0\n\n```\n- mustBe renamed to include.\n- mustNotBe renamed to exclude.\n- The getResult(s) includes percent.\n- You can create an object as a fully customizable score range. { \"score\" : \"message\" }\n  Conditions :\n    1. The score range must have at least two members.\n    2. The last member of the score range must be \"_\".\n```\n\n##### Version 2.0\n\n```\n- getScore() renamed to getResult() \n- getScores() renamed to getResults()\n```\n\n\u003chr/\u003e\n\n\u003cdiv\u003eIcons made by \u003ca href=\"https://www.freepik.com\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedfathi%2Fpasswordmeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamedfathi%2Fpasswordmeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedfathi%2Fpasswordmeter/lists"}