{"id":17353203,"url":"https://github.com/zacanger/cracklibjs","last_synced_at":"2025-03-30T09:27:47.784Z","repository":{"id":66228189,"uuid":"148044929","full_name":"zacanger/cracklibjs","owner":"zacanger","description":"Pure JS Cracklib-inspired library for Node.","archived":false,"fork":false,"pushed_at":"2024-06-02T23:31:45.000Z","size":2354,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T13:25:26.395Z","etag":null,"topics":["cracklib","js","libcrack","node","password","security"],"latest_commit_sha":null,"homepage":"http://npm.im/cracklibjs","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/zacanger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-09T16:38:08.000Z","updated_at":"2024-06-02T23:31:48.000Z","dependencies_parsed_at":"2024-06-03T01:02:27.446Z","dependency_job_id":"889afd6c-9549-495a-ba81-457aa841f4b7","html_url":"https://github.com/zacanger/cracklibjs","commit_stats":{"total_commits":175,"total_committers":2,"mean_commits":87.5,"dds":0.03428571428571425,"last_synced_commit":"354aabc3d956769bd00e57af92067d72e87b30de"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacanger%2Fcracklibjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacanger%2Fcracklibjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacanger%2Fcracklibjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zacanger%2Fcracklibjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zacanger","download_url":"https://codeload.github.com/zacanger/cracklibjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245798315,"owners_count":20673901,"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":["cracklib","js","libcrack","node","password","security"],"created_at":"2024-10-15T17:15:55.600Z","updated_at":"2025-03-30T09:27:47.756Z","avatar_url":"https://github.com/zacanger.png","language":"TypeScript","funding_links":["https://ko-fi.com/zacanger"],"categories":[],"sub_categories":[],"readme":"# cracklibjs\n\nPure JS Cracklib-inspired library for Node.\n\n[![npm version](https://img.shields.io/npm/v/cracklibjs.svg)](https://npm.im/cracklibjs) [![CircleCI](https://circleci.com/gh/zacanger/cracklibjs.svg?style=svg)](https://circleci.com/gh/zacanger/cracklibjs) [![codecov](https://codecov.io/gh/zacanger/cracklibjs/branch/master/graph/badge.svg)](https://codecov.io/gh/zacanger/cracklibjs) [![Known Vulnerabilities](https://snyk.io/test/github/zacanger/cracklibjs/badge.svg?targetFile=package.json)](https://snyk.io/test/github/zacanger/cracklibjs?targetFile=package.json)\n\n[Donate](https://ko-fi.com/zacanger)\n\n--------\n\n## Installation\n\n`npm i cracklibjs`\n\n## Usage\n\n```javascript\nimport cracklib from 'cracklibjs'\n// if you're using `require`, you'll need to `require('cracklibjs').default`\n\nconst pw = process.argv[2] // or something\n\n// Init with options. The wordlist is parsed here, so future calls\n// don't have to do all that work again.\n// `check: (word: string) =\u003e PasswordValidationError | string (word)`\nconst check = cracklib() // cracklib(options)\n// The `options` param is optional.\n// type Options = {\n//   dict: string = '/usr/share/dict/words'; path to dictionary file\n//   minLength: number = 8; minimum password length\n//   loose: bool = false; see below for loose vs strict\n// }\n\nconst validate = (pw) =\u003e {\n  try {\n    return check(pw)\n  } catch (e) {\n    return e.message // example: 'Password is too short'\n  }\n}\n```\n\nThe `loose` option, when true, disables:\n* Case-insensitive checks\n* Reversed string checks\n* md5, sha1, sha256, and sha512 checks\n\n## Questions\n\n* Why?\n  * The npm package `cracklib` isn't a vanilla JS solution, has external\n    dependencies, and may not build on all Unix-like systems and future versions\n    of Node.\n* I have more than one word list, what should I do?\n  * Try [`cat(1)`](https://www.mankier.com/1/cat)\n* This seems slow!\n  * Don't initialize more than once. Initialization _can_ be slow, depending on\n    your word list and your machine. Hopefully the actual check is fast.\n\n[LICENSE](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacanger%2Fcracklibjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzacanger%2Fcracklibjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzacanger%2Fcracklibjs/lists"}