{"id":27304216,"url":"https://github.com/arjun-9696/cyberauth-utils","last_synced_at":"2025-04-12T03:23:10.996Z","repository":{"id":287195283,"uuid":"963880658","full_name":"Arjun-9696/CyberAuth-Utils","owner":"Arjun-9696","description":"Secure and lightweight authentication utility library for Node.js, TypeScript, and Next.js. Includes password hashing, JWT, OAuth helpers, and secure cookie handling.","archived":false,"fork":false,"pushed_at":"2025-04-10T12:24:43.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T13:49:41.198Z","etag":null,"topics":["bycrypt","jswebtoken","typescript","vitest"],"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/Arjun-9696.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-10T10:58:50.000Z","updated_at":"2025-04-10T12:24:46.000Z","dependencies_parsed_at":"2025-04-10T13:49:43.194Z","dependency_job_id":"90b2b772-dc4b-48a3-ab1d-90963a14d8d5","html_url":"https://github.com/Arjun-9696/CyberAuth-Utils","commit_stats":null,"previous_names":["arjun-9696/cyberauth-utils"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arjun-9696%2FCyberAuth-Utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arjun-9696%2FCyberAuth-Utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arjun-9696%2FCyberAuth-Utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arjun-9696%2FCyberAuth-Utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arjun-9696","download_url":"https://codeload.github.com/Arjun-9696/CyberAuth-Utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248510788,"owners_count":21116274,"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":["bycrypt","jswebtoken","typescript","vitest"],"created_at":"2025-04-12T03:23:10.434Z","updated_at":"2025-04-12T03:23:10.971Z","avatar_url":"https://github.com/Arjun-9696.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 CyberAuth Utils v0.0.1 [![npm version](https://img.shields.io/npm/v/@arjun-9696/cyberauth-utils)](https://www.npmjs.com/package/@arjun-9696/cyberauth-utils)\n\nA lightweight package for secure authentication utilities.\n## 🔐 Features\n\n- Password hashing and verification\n- JWT generation and validation\n- OAuth helpers for React/Next.js\n- Secure cookie management\n\n## 📦 Package Setup:\n- TypeScript support with strict types\n- Proper `tsconfig.json` and `tsup.config.ts` for builds\n- MIT License included\n- Clean `.gitignore` and organized file structure\n- Readable `README.md` with professional formatting\n\n## 🧪 Testing:\n- Manual testing script (`tests/hash.test.ts`) to verify all core utilities\n- Output logs added for confirmation\n\n## 🛠️ Ready for publishing on npm with name `cyberauth-utils`.\n\n## Installation\n\n```bash\nnpm install cyberauth-utils\n```\n\n## Usage\n\n```ts\nimport { hashPassword } from 'cyberauth-utils';\n\nconst password = 'mySecurePassword123!';\nconst hashedPassword = await hashPassword(password);\n\nconsole.log('Hashed Password:', hashedPassword);\n```\n```ts\nimport { generateJWT } from 'cyberauth-utils';\n\nconst payload = { userId: '123', role: 'admin' };\nconst secret = 'my_super_secret_key';\nconst token = generateJWT(payload, secret, { expiresIn: '2h' });\n\nconsole.log('JWT Token:', token);\n```\n```ts\nimport { verifyJWT } from 'cyberauth-utils';\n\nconst payload = verifyJWT(token, 'my_super_secret_key');\n\nif (payload) {\n  console.log('Decoded Payload:', payload);\n} else {\n  console.log('Invalid token');\n}\n```\n```ts\nimport { setSecureCookie } from 'cyberauth-utils';\n\nconst cookie = setSecureCookie('authToken', 'xyz123token', {\n  maxAgeSeconds: 3600,\n  path: '/',\n  httpOnly: true,\n  secure: true,\n  sameSite: 'lax',\n});\n\nconsole.log('Set-Cookie Header:', cookie);\n```\n```ts\nimport { parseCookies } from 'cyberauth-utils';\n\nconst cookieHeader = 'authToken=xyz123token; theme=dark';\nconst cookies = parseCookies(cookieHeader);\n\nconsole.log('Parsed Cookies:', cookies);\n// Output: { authToken: 'xyz123token', theme: 'dark' }\n```\n\n## License\n\nMIT\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-9696%2Fcyberauth-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjun-9696%2Fcyberauth-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun-9696%2Fcyberauth-utils/lists"}