UNPKG

@the-node-forge/jwt-utils

Version:

A flexible, lightweight Node.js JWT library for generating, verifying, and managing JSON Web Tokens (JWTs). Supports access and refresh tokens with customizable secrets for authentication and role-based access control. Includes middleware for Express, Fas

186 lines (185 loc) 5.49 kB
{ "name": "@the-node-forge/jwt-utils", "version": "1.1.1", "description": "A flexible, lightweight Node.js JWT library for generating, verifying, and managing JSON Web Tokens (JWTs). Supports access and refresh tokens with customizable secrets for authentication and role-based access control. Includes middleware for Express, Fastify, Koa, Hapi, NestJS, and Next.js to streamline authentication in modern web applications.", "exports": { ".": { "import": "./dist/mjs/index.mjs", "require": "./dist/cjs/index.js" }, "./middleware/express": { "import": "./dist/mjs/middleware/express.mjs", "require": "./dist/cjs/middleware/express.js" }, "./middleware/fastify": { "import": "./dist/mjs/middleware/fastify.mjs", "require": "./dist/cjs/middleware/fastify.js" }, "./middleware/koa": { "import": "./dist/mjs/middleware/koa.mjs", "require": "./dist/cjs/middleware/koa.js" }, "./middleware/hapi": { "import": "./dist/mjs/middleware/hapi.mjs", "require": "./dist/cjs/middleware/hapi.js" }, "./middleware/next": { "import": "./dist/mjs/middleware/next.mjs", "require": "./dist/cjs/middleware/next.js" }, "./middleware/nest": { "import": "./dist/mjs/middleware/nest.mjs", "require": "./dist/cjs/middleware/nest.js" }, "./middleware/rbac": { "import": "./dist/mjs/middleware/rbac.mjs", "require": "./dist/cjs/middleware/rbac.js" } }, "main": "dist/cjs/index.cjs", "module": "dist/mjs/index.mjs", "types": "dist/mjs/index.d.ts", "scripts": { "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", "format": "prettier --write .", "format:check": "prettier --check .", "lint": "eslint .", "lint:fix": "eslint . --fix", "prepublishOnly": "npm run build", "clean": "rm -rf dist", "build": "npm run clean && npm run build:cjs && npm run build:mjs", "build:cjs": "tsc --project tsconfig.cjs.json && find dist/cjs -name '*.js' -exec sh -c 'cp \"$1\" \"${1%.js}.cjs\"' _ {} \\; && find dist/cjs -name '*.d.ts' -exec sh -c 'mv \"$1\" \"${1%.d.ts}.d.cts\"' _ {} \\;", "build:mjs": "tsc --project tsconfig.mjs.json && find dist/mjs -name '*.js' -exec sh -c 'cp \"$1\" \"${1%.js}.mjs\"' _ {} \\; && find dist/mjs -name '*.d.ts' -exec sh -c 'mv \"$1\" \"${1%.d.ts}.d.mts\"' _ {} \\;", "docs:generate": "typedoc --plugin typedoc-plugin-markdown --out docs/api src/index.ts", "docs:build": "npm run docs:generate && cd docs && npm run build", "docs:start": "npm run docs:generate && cd docs && npm start", "docs:clean": "rm -rf docs/build && npm run docs:generate && npm run docs:build", "docs:deploy": "cd docs && npm run deploy" }, "repository": { "type": "git", "url": "https://github.com/The-Node-Forge/jwt-utils" }, "keywords": [ "jwt", "jsonwebtoken", "authentication", "authorization", "token", "jwt-auth", "jwt-utils", "jwt-verification", "jwt-middleware", "koa", "fastify", "express", "hapi", "nestjs", "nextjs", "koa-middleware", "fastify-middleware", "express-middleware", "hapi-middleware", "nextjs-middleware", "nestjs-middleware", "secure", "security", "auth-middleware", "jwt-security", "access-token", "refresh-token", "bearer-token", "node", "typescript", "nodejs", "backend", "web-auth", "user-auth", "auth-utils", "token-management", "web-security", "role-based-access", "rbac", "jwt-rbac" ], "author": { "name": "Lanny MacMillan", "url": "https://github.com/Lanny-MacMillan" }, "license": "MIT", "files": [ "dist", "README.md" ], "devDependencies": { "@eslint/compat": "^1.2.5", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.19.0", "@hapi/hapi": "^21.3.12", "@nestjs/common": "^11.0.10", "@nestjs/core": "^11.0.10", "@types/express": "^5.0.0", "@types/jest": "^29.5.14", "@types/jsonwebtoken": "^9.0.8", "@types/koa": "^2.15.0", "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^8.22.0", "@typescript-eslint/parser": "^8.22.0", "eslint": "^9.19.0", "eslint-config-prettier": "^10.0.1", "eslint-import-resolver-typescript": "^3.7.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.3", "express": "^4.21.2", "fastify": "^4.29.1", "globals": "^15.14.0", "jest": "^29.7.0", "koa": "^2.15.4", "next": "^15.1.7", "prettier": "^3.4.2", "reflect-metadata": "^0.2.2", "rxjs": "^7.8.2", "supertest": "^7.0.0", "ts-jest": "^29.2.5", "typedoc": "^0.27.6", "typedoc-plugin-markdown": "^4.4.1", "typescript": "^5.7.3" }, "peerDependencies": { "@hapi/hapi": ">=21.0.0", "@nestjs/common": ">=9.0.0", "@nestjs/core": ">=9.0.0", "express": ">=4.0.0", "fastify": ">=4.0.0", "koa": ">=2.0.0", "next": ">=12.0.0" }, "peerDependenciesMeta": { "express": { "optional": true }, "fastify": { "optional": true }, "koa": { "optional": true }, "@hapi/hapi": { "optional": true }, "next": { "optional": true }, "@nestjs/common": { "optional": true }, "@nestjs/core": { "optional": true } }, "dependencies": { "jsonwebtoken": "^9.0.2" } }