{"id":18533486,"url":"https://github.com/mattiamalonni/sequelize-bcrypt","last_synced_at":"2025-04-09T15:31:22.647Z","repository":{"id":143908137,"uuid":"424250598","full_name":"mattiamalonni/sequelize-bcrypt","owner":"mattiamalonni","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-24T13:24:04.000Z","size":26,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T12:42:20.200Z","etag":null,"topics":["bcrypt","sequelize","sequelize-extension","sequelize-plugin"],"latest_commit_sha":null,"homepage":"","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/mattiamalonni.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T14:11:27.000Z","updated_at":"2025-02-05T08:18:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"f208428c-0d96-42ad-81cb-6da61ebe9265","html_url":"https://github.com/mattiamalonni/sequelize-bcrypt","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/mattiamalonni%2Fsequelize-bcrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamalonni%2Fsequelize-bcrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamalonni%2Fsequelize-bcrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamalonni%2Fsequelize-bcrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattiamalonni","download_url":"https://codeload.github.com/mattiamalonni/sequelize-bcrypt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248057941,"owners_count":21040666,"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":["bcrypt","sequelize","sequelize-extension","sequelize-plugin"],"created_at":"2024-11-06T19:11:48.856Z","updated_at":"2025-04-09T15:31:22.130Z","avatar_url":"https://github.com/mattiamalonni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sequelize-bcrypt\n\n## Installation\n\n```bash\nnpm i sequelize-bcrypt\n```\n\n## Setup\n\n```javascript\nconst { Sequelize, DataTypes } = require('sequelize');\nconst useBcrypt = require('sequelize-bcrypt');\n\nconst database = new Sequelize({\n  ...sequelizeConnectionOptions,\n});\n\nconst User = database.define('User', {\n  email: { type: DataTypes.STRING },\n  password: { type: DataTypes.STRING },\n});\n\nuseBcrypt(User, options);\n```\n\n## Options\n\n```javascript\n{\n  field: 'password', // secret field to hash, default: 'password'\n  rounds: 12, // used to generate bcrypt salt, default: 12\n  compare: 'authenticate', // method used to compare secrets, default: 'authenticate'\n}\n```\n\n## Usage\n\n```javascript\nUser.create({ email: 'john.doe@example.com', password: 'SuperSecret!' });\n// { id: 1, email: 'john.doe@example.com', password: '$2a$12$VtyL7j5xx6t/GmmAqy53ZuKJ1nwPox5kHLXDaottN9tIQBsEB3EsW' }\n\nconst user = await User.findOne({ where: { email: 'john.doe@example.com' } });\nuser.authenticate('WrongPassword!'); // false\nuser.authenticate('SuperSecret!'); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamalonni%2Fsequelize-bcrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattiamalonni%2Fsequelize-bcrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamalonni%2Fsequelize-bcrypt/lists"}