{"id":22535628,"url":"https://github.com/vkondratiuk482/jwt","last_synced_at":"2026-05-17T00:02:40.512Z","repository":{"id":65748421,"uuid":"582079445","full_name":"vkondratiuk482/jwt","owner":"vkondratiuk482","description":"Library created for educational purposes to sign and decode JWT tokens using symmetric and asymmetric algorithms (HS256, RS256). Dependency free","archived":false,"fork":false,"pushed_at":"2023-02-18T20:11:31.000Z","size":85,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-12T15:58:51.812Z","etag":null,"topics":["asymmetric-cryptography","dependency-free","hs256","jsonwebtoken","jwt","node","rs256","symmetric-cryptography"],"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/vkondratiuk482.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-12-25T15:31:59.000Z","updated_at":"2025-04-01T07:30:43.000Z","dependencies_parsed_at":"2023-06-28T14:30:20.820Z","dependency_job_id":null,"html_url":"https://github.com/vkondratiuk482/jwt","commit_stats":null,"previous_names":["mokuteki225/jwt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vkondratiuk482/jwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkondratiuk482%2Fjwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkondratiuk482%2Fjwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkondratiuk482%2Fjwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkondratiuk482%2Fjwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vkondratiuk482","download_url":"https://codeload.github.com/vkondratiuk482/jwt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vkondratiuk482%2Fjwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279196100,"owners_count":26124064,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["asymmetric-cryptography","dependency-free","hs256","jsonwebtoken","jwt","node","rs256","symmetric-cryptography"],"created_at":"2024-12-07T10:08:06.334Z","updated_at":"2025-10-16T23:34:26.518Z","avatar_url":"https://github.com/vkondratiuk482.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @mokuteki/jwt\nZero dependency typescript friendly Node.js library designed to hash/decode JSON Web Tokens using symmetric/asymmetric algorithms\n\n## Installation\n```bash\nnpm i @mokuteki/jwt\n```\n\n## Quick start \n\n* Pick one hashing strategy out of existing ones\n* Pass the strategy to JSONWebToken constructor\n* Use created instance to generate/verify JWTs\n\n## HS256 Strategy\n\n```javascript\nconst { JSONWebToken, HS256Strategy } = require('@mokuteki/jwt');\n\nconst strategy = new HS256Strategy({\n  ttl: 10000,\n  secret: 'YOUR_SECRET',\n});\n\nconst jwt = new JSONWebToken(strategy);\nconst payload = { id: 1 };\n\nconst token = jwt.generate(payload);\nconst decoded = jwt.verify(token);\n\nconsole.log(decoded); // { id: 1 }\n```\n\n## RS256 Strategy\n\n```javascript\nconst { JSONWebToken, RS256Strategy } = require('@mokuteki/jwt');\n\nconst strategy = new RS256Strategy({\n  ttl: 10000,\n  publicKey: 'YOUR_PUBLIC_KEY',\n  privateKey: 'YOUR_PRIVATE_KEY',\n});\n\nconst jwt = new JSONWebToken(strategy);\nconst payload = { id: 1 };\n\nconst token = jwt.generate(payload);\nconst decoded = jwt.verify(token);\n\nconsole.log(decoded); // { id: 1 }\n```\n\n## Override predefined options\n\n```javascript\nconst { JSONWebToken, HS256Strategy } = require('@mokuteki/jwt');\n\nconst strategy = new HS256Strategy({\n  ttl: 10000,\n  secret: 'YOUR_SECRET',\n});\n\nconst jwt = new JSONWebToken(strategy);\nconst payload = { id: 1 };\n\n/**\n * Override JWT ttl option\n */\nconst token = jwt.generate(payload, { ttl: 1000 });\n\nsetTimeout(() =\u003e {\n  try {\n    const decoded = jwt.verify(token);\n  } catch (err) {\n    // err instanceof JwtExpiredError\n  }\n}, 2000);\n```\n\n```javascript\nconst { JSONWebToken, HS256Strategy } = require('@mokuteki/jwt');\n\nconst strategy = new HS256Strategy({\n  ttl: 10000,\n  secret: 'YOUR_SECRET',\n});\n\nconst jwt = new JSONWebToken(strategy);\nconst payload = { id: 1 };\n\nconst token = jwt.generate(payload, { ttl: 20000, secret: 'NEW_SECRET' });\n\ntry {\n  const decoded = jwt.verify(token);\n} catch (err) {\n  // err instanceof InvalidSignatureError\n}\n```\n\n## License\nLicensed under [MIT](https://github.com/mokuteki225/jwt/blob/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkondratiuk482%2Fjwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvkondratiuk482%2Fjwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvkondratiuk482%2Fjwt/lists"}