{"id":22064697,"url":"https://github.com/ldarren/pico-jwt","last_synced_at":"2025-07-25T09:43:07.366Z","repository":{"id":57323896,"uuid":"118545325","full_name":"ldarren/pico-jwt","owner":"ldarren","description":"A pico-sized JWT module","archived":false,"fork":false,"pushed_at":"2024-08-04T06:53:45.000Z","size":18,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-29T10:48:22.722Z","etag":null,"topics":["authentication","jwt","jwt-decode","jwt-encode"],"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/ldarren.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":"2018-01-23T02:24:20.000Z","updated_at":"2024-08-04T06:50:44.000Z","dependencies_parsed_at":"2024-10-20T19:24:58.353Z","dependency_job_id":null,"html_url":"https://github.com/ldarren/pico-jwt","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"cac4849a183738d31f868d2edfc3f55fa0713f46"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Fpico-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Fpico-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Fpico-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldarren%2Fpico-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldarren","download_url":"https://codeload.github.com/ldarren/pico-jwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253391502,"owners_count":21900952,"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":["authentication","jwt","jwt-decode","jwt-encode"],"created_at":"2024-11-30T19:13:14.210Z","updated_at":"2025-05-13T01:14:54.788Z","avatar_url":"https://github.com/ldarren.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pico-jwt\nA pico-sized JWT module\n\n## Why?\n- Small footprint (184 LOC uncompressed)\n- Simple and easy\n- Minimum dependencies ([ecdsa-sig-formatter](https://github.com/Brightspace/node-ecdsa-sig-formatter))\n\n## Installation\n`npm i pico-jwt`\n\n## Algorithms\nThis library supports most of the cryptographic algorithms for JWT:\n\nalg Parameter Value | Digital Signature or MAC Algorithm\n----------------|----------------------------\nHS256 | HMAC using SHA-256 hash algorithm\nHS384 | HMAC using SHA-384 hash algorithm\nHS512 | HMAC using SHA-512 hash algorithm\nRS256 | RSASSA using SHA-256 hash algorithm\nRS384 | RSASSA using SHA-384 hash algorithm\nRS512 | RSASSA using SHA-512 hash algorithm\nPS256 | RSASSA-PSS using SHA-256 hash algorithm\nPS384 | RSASSA-PSS using SHA-384 hash algorithm\nPS512 | RSASSA-PSS using SHA-512 hash algorithm\nES256 | ECDSA using P-256 curve and SHA-256 hash algorithm\nES384 | ECDSA using P-384 curve and SHA-384 hash algorithm\nES512 | ECDSA using P-521 curve and SHA-512 hash algorithm\n\nPlease note that PSXXX only works on Node 6.12+ (excluding 7.x).\n\n## Test\n`npm test`\n\n## Example\n```javascript\n// import module\nconst pJWT = require('pico-jwt')\n\n// instantiate the module\nconst jwt = new pJWT('HS256', 'secretKey')\n\n// or with private and public keys\n// const jwt = new pJWT('RS256', 'privateKey', 'publicKey')\n\n// or with private and public files (absolute path only)\n// const jwt = new pJWT('RS256', 'privateKeyPath', 'publicKeyPath')\n\n// or add key files asynchronous (absolute path only)\n// jwt.addKeys('privateKeyPath', 'publicKeyPath', () =\u003e {\n//\tconsole.log('loaded')\n//})\n\n// create jwt with payload\nconst token = jwt.create({\n\tiss: 'pico',\n\thello: 'world'\n}, {\n\tkid: 'custom-header-key-id'\n})\n\n// get header of jwt\nconst header = jwt.header(token) // or pJWT.prototype.header(token)\n\n// get payload of jwt\nconst payload = jwt.payload(token) // or pJWT.prototype.payload(token)\n\n// verify jwt\nif (!jwt.verify(token)) {\n\tconsole.log('failed')\n}\n```\n\n## Debug Mode\nSet `DEBUG` env variable to enable debug mode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldarren%2Fpico-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldarren%2Fpico-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldarren%2Fpico-jwt/lists"}