{"_id":"@oslojs/jwt","_rev":"4-168a5f22e7804408f1f44861cb52401d","name":"@oslojs/jwt","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@oslojs/jwt","version":"0.1.0","keywords":["auth","jwt"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/jwt@0.1.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/jwt#readme","bugs":{"url":"https://github.com/oslo-project/jwt/issues"},"dist":{"shasum":"c8e4408f4667620ddc9f8a67ba5feca73f191482","tarball":"https://registry.npmjs.org/@oslojs/jwt/-/jwt-0.1.0.tgz","fileCount":5,"integrity":"sha512-g6JHWeCl9OkHLeoaaKUZoQUfCzhn2U5hYnyoT7/Uh/HY0AGpf0odmFViW6AhPKaOOVXKITvoOArEhec1vEd6GA==","signatures":[{"sig":"MEUCIC0LcwBBSxPdVDxzDrZA23KeAvmkroe6hxJy99+HW/hbAiEA1w+48QxtdC2AYPPELzpx6EdG3KInEdI1ZIRu+ljSRbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14508},"main":"dist/index.js","type":"module","_from":"file:oslojs-jwt-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","test":"vitest run --sequence.concurrent","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/897eb71ca460dae8f4a41d7d8de3b794/oslojs-jwt-0.1.0.tgz","_integrity":"sha512-g6JHWeCl9OkHLeoaaKUZoQUfCzhn2U5hYnyoT7/Uh/HY0AGpf0odmFViW6AhPKaOOVXKITvoOArEhec1vEd6GA==","repository":{"url":"git+https://github.com/oslo-project/jwt.git","type":"git"},"_npmVersion":"10.5.0","description":"Parse and encoding JSON web tokens","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/encoding":"0.4.1"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","vitest":"^0.34.6","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/jwt_0.1.0_1726483066203_0.26559943015611953","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"@oslojs/jwt","version":"0.2.0","keywords":["auth","jwt"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/jwt@0.2.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/jwt#readme","bugs":{"url":"https://github.com/oslo-project/jwt/issues"},"dist":{"shasum":"cdcd51e562eed2e536d273c840e90648c2d4a54a","tarball":"https://registry.npmjs.org/@oslojs/jwt/-/jwt-0.2.0.tgz","fileCount":5,"integrity":"sha512-bLE7BtHrURedCn4Mco3ma9L4Y1GR2SMBuIvjWr7rmQ4/W/4Jy70TIAgZ+0nIlk0xHz1vNP8x8DCns45Sb2XRbg==","signatures":[{"sig":"MEUCIQCSnFfy9vbclI1P3zdqhuCQCyvwih6Fr7cqd4/8P1EGZAIgBVewz1qQYDtPaDlTDpBJLhOWf5la9nH6FDtE45RP/m4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15317},"main":"dist/index.js","type":"module","_from":"file:oslojs-jwt-0.2.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","test":"vitest run --sequence.concurrent","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/e08a834921c4e9608d600a6e0cc4675c/oslojs-jwt-0.2.0.tgz","_integrity":"sha512-bLE7BtHrURedCn4Mco3ma9L4Y1GR2SMBuIvjWr7rmQ4/W/4Jy70TIAgZ+0nIlk0xHz1vNP8x8DCns45Sb2XRbg==","repository":{"url":"git+https://github.com/oslo-project/jwt.git","type":"git"},"_npmVersion":"10.5.0","description":"Parse and encoding JSON web tokens","directories":{},"_nodeVersion":"21.7.0","dependencies":{"@oslojs/encoding":"0.4.1"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","vitest":"^0.34.6","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/jwt_0.2.0_1726666222374_0.7208315139681456","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.0":{"name":"@oslojs/jwt","version":"0.3.0","keywords":["auth","jwt"],"author":{"name":"pilcrowOnPaper"},"license":"MIT","_id":"@oslojs/jwt@0.3.0","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"homepage":"https://github.com/oslo-project/jwt#readme","bugs":{"url":"https://github.com/oslo-project/jwt/issues"},"dist":{"shasum":"10e1cabdb86338f9ec968d182e20fce29531c7ea","tarball":"https://registry.npmjs.org/@oslojs/jwt/-/jwt-0.3.0.tgz","fileCount":5,"integrity":"sha512-bg9hh6gc7ppS2haLv2nE7oezroXK6a6zGTz6JzCHXAQKCOOZM4HfOrV9DwCaDimrTcDi1nHAe2ueAAxZ23eeUA==","signatures":[{"sig":"MEUCIQDoLClL4HJ9Wc2fs01LMxeZacM1MEM4bbSrFOyg0lsjpgIgIZXaWKzOtOJxXVOzp7lcvsgzGvSF1y48uFDasjBzQ9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15337},"main":"dist/index.js","type":"module","_from":"file:oslojs-jwt-0.3.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","scripts":{"lint":"eslint src","test":"vitest run --sequence.concurrent","build":"rm -rf dist/* && tsc --project tsconfig.build.json","format":"prettier -w ."},"_npmUser":{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"},"_resolved":"/private/var/folders/qb/z2pf2nq559n552wvjqbjddww0000gn/T/b44119308a2a1954fc7543e068ecfc3f/oslojs-jwt-0.3.0.tgz","_integrity":"sha512-bg9hh6gc7ppS2haLv2nE7oezroXK6a6zGTz6JzCHXAQKCOOZM4HfOrV9DwCaDimrTcDi1nHAe2ueAAxZ23eeUA==","repository":{"url":"git+https://github.com/oslo-project/jwt.git","type":"git"},"_npmVersion":"10.9.0","description":"Parse and encoding JSON web tokens","directories":{},"_nodeVersion":"22.10.0","dependencies":{"@oslojs/encoding":"0.4.1"},"_hasShrinkwrap":false,"devDependencies":{"auri":"^2.0.0","eslint":"^8.51.0","vitest":"^0.34.6","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.6","@typescript-eslint/parser":"^6.7.5","@typescript-eslint/eslint-plugin":"^6.7.5"},"_npmOperationalInternal":{"tmp":"tmp/jwt_0.3.0_1732340863131_0.928460027123555","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2024-09-16T10:37:46.058Z","modified":"2026-07-29T13:04:45.999Z","0.1.0":"2024-09-16T10:37:46.337Z","0.2.0":"2024-09-18T13:30:22.543Z","0.3.0":"2024-11-23T05:47:43.359Z"},"bugs":{"url":"https://github.com/oslo-project/jwt/issues"},"author":{"name":"pilcrowOnPaper"},"license":"MIT","homepage":"https://github.com/oslo-project/jwt#readme","keywords":["auth","jwt"],"repository":{"url":"git+https://github.com/oslo-project/jwt.git","type":"git"},"description":"Parse and encoding JSON web tokens","maintainers":[{"name":"pilcrowonpaper","email":"pilcrowonpaper@gmail.com"}],"readme":"# @oslojs/jwt\n\n**Documentation: https://jwt.oslojs.dev**\n\nA JavaScript library for parsing and encoding JSON web tokens (JWT) by [Oslo](https://oslojs.dev). Only signed tokens are supported.\n\n- Runtime-agnostic\n- No third-party dependencies\n- Fully typed\n\n```ts\nimport { parseJWT, JWSRegisteredHeaders, JWTRegisteredClaims, joseAlgorithmHS256 } from \"@oslojs/jwt\";\n\nconst [header, payload, signature] = parseJWT(jwt);\nconst headerParameters = new JWSRegisteredHeaders(header);\nif (header.algorithm() !== joseAlgorithmHS256) {\n\tthrow new Error(\"Unsupported algorithm\");\n}\nconst claims = new JWTRegisteredClaims(payload);\nif (!claims.verifyExpiration()) {\n\tthrow new Error(\"Expired token\");\n}\nif (claims.hasNotBefore() && !claims.verifyNotBefore()) {\n\tthrow new Error(\"Invalid token\");\n}\n```\n\n## Installation\n\n```\nnpm i @oslojs/jwt\n```\n","readmeFilename":"README.md"}