{"_id":"@aslina/next-app-router-decorator","_rev":"3-7a734542058e2c002999b49a81694028","name":"@aslina/next-app-router-decorator","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.5":{"name":"@aslina/next-app-router-decorator","version":"1.0.5","keywords":["nextjs","api","handler","router","page-router"],"author":{"name":"echaoeoen","email":"echaoeoen@gmail.com"},"license":"ISC","_id":"@aslina/next-app-router-decorator@1.0.5","maintainers":[{"name":"echaoeoen","email":"andyepso@gmail.com"}],"homepage":"https://github.com/echaoeoen/next-api#readme","bugs":{"url":"https://github.com/echaoeoen/next-api/issues"},"dist":{"shasum":"8e49c208701ebbb05886fd41e2ec1cb01c030ebe","tarball":"https://registry.npmjs.org/@aslina/next-app-router-decorator/-/next-app-router-decorator-1.0.5.tgz","fileCount":69,"integrity":"sha512-Y1X/6ZAkzsp5BYojZtYOj7ncPPLxtLc5tIjFbLDn2z1Rh+oZMs9WlZ3UjvBVe1B/xWqjKk7C9J0gL7xbiPd3EA==","signatures":[{"sig":"MEUCIQDTLYATveRrj+PXNYodT0GEtst9Y4lVOchoc2EvfLvAkQIgJiV3oxunvOd4tubzWk8jCihO0ANk/f7ugQFp5ryTDIE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170158},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"8fb3cc09f52a91b8a70a0a5937005b316910020a","scripts":{"test":"jest","build":"rimraf dist && tsc"},"_npmUser":{"name":"echaoeoen","email":"andyepso@gmail.com"},"repository":{"url":"git+https://github.com/echaoeoen/next-api.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextjs API decorator helper","directories":{},"_nodeVersion":"20.18.0","dependencies":{"next":"^14.2.11","react":"^18.3.1","cryptr":"^6.3.0","cookies-next":"^4.2.1","class-validator":"^0.14.1","reflect-metadata":"^0.2.2","class-transformer":"^0.5.1","http-status-codes":"^2.3.0","@aslina/app-context":"^1.1.7","node-application-context":"^1.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","jest":"^29.7.0","eslint":"^9.10.0","rimraf":"^6.0.1","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.5.4"},"_npmOperationalInternal":{"tmp":"tmp/next-app-router-decorator_1.0.5_1739297889874_0.7759164224926889","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@aslina/next-app-router-decorator","version":"1.0.6","keywords":["nextjs","api","handler","router","page-router"],"author":{"name":"echaoeoen","email":"echaoeoen@gmail.com"},"license":"ISC","_id":"@aslina/next-app-router-decorator@1.0.6","maintainers":[{"name":"echaoeoen","email":"andyepso@gmail.com"}],"homepage":"https://github.com/echaoeoen/next-api#readme","bugs":{"url":"https://github.com/echaoeoen/next-api/issues"},"dist":{"shasum":"26ea9eec0d0f98cbdae8b092aff38d2f1b9128ed","tarball":"https://registry.npmjs.org/@aslina/next-app-router-decorator/-/next-app-router-decorator-1.0.6.tgz","fileCount":69,"integrity":"sha512-eFUvQKlPBbxkpoxr9J7lwf5Qgk8+3TMxSA2Gayb6O+kENhVm7mls3ZC2UTtYKq91+MG72p4QtXhwO2gYsBJmIw==","signatures":[{"sig":"MEQCIFGU3ZxPmENZe0AG+S8EnM7gxnFFNsu30raVNQ3YLF4fAiAGu4NcPGkIqdoZ0OrT57h6qyZ667U9KNU0A9/mXqJcFw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170201},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"fbacb6c8b2db87954af87c6571586c7d70dcbb91","scripts":{"test":"jest","build":"rimraf dist && tsc"},"_npmUser":{"name":"echaoeoen","email":"andyepso@gmail.com"},"repository":{"url":"git+https://github.com/echaoeoen/next-api.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextjs API decorator helper","directories":{},"_nodeVersion":"20.18.0","dependencies":{"next":"^14.2.11","react":"^18.3.1","cryptr":"^6.3.0","cookies-next":"^4.2.1","class-validator":"^0.14.1","reflect-metadata":"^0.2.2","class-transformer":"^0.5.1","http-status-codes":"^2.3.0","@aslina/app-context":"^1.1.7","node-application-context":"^1.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","jest":"^29.7.0","eslint":"^9.10.0","rimraf":"^6.0.1","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.5.4"},"_npmOperationalInternal":{"tmp":"tmp/next-app-router-decorator_1.0.6_1739301548995_0.18039748646244957","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@aslina/next-app-router-decorator","version":"1.0.7","keywords":["nextjs","api","handler","router","page-router"],"author":{"name":"echaoeoen","email":"echaoeoen@gmail.com"},"license":"ISC","_id":"@aslina/next-app-router-decorator@1.0.7","maintainers":[{"name":"echaoeoen","email":"andyepso@gmail.com"}],"homepage":"https://github.com/echaoeoen/next-api#readme","bugs":{"url":"https://github.com/echaoeoen/next-api/issues"},"dist":{"shasum":"ec13a0630a64e4c6f792b9325fc5fbfdb0139282","tarball":"https://registry.npmjs.org/@aslina/next-app-router-decorator/-/next-app-router-decorator-1.0.7.tgz","fileCount":69,"integrity":"sha512-kX8QMMJf08bmYAM0jycs02RAhYdPyWGFxeepMU4U2j54wl3+pCWnNkjlOEkvamHAiLxgDVROJsq+IypjQVDo9w==","signatures":[{"sig":"MEYCIQD7K5xBCeF2MvSw8OjqIVSvpwY+KsHvbuRb3ZDheu1kQwIhAKyzWRfiopEOubHeSJFQt7YyhehGPQ3R+MwpShxDAht0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170252},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"61bcead23fc8e1547008f9b4f44f3a3fe7207a7e","scripts":{"test":"jest","build":"rimraf dist && tsc"},"_npmUser":{"name":"echaoeoen","email":"andyepso@gmail.com"},"repository":{"url":"git+https://github.com/echaoeoen/next-api.git","type":"git"},"_npmVersion":"10.8.3","description":"Nextjs API decorator helper","directories":{},"_nodeVersion":"20.18.0","dependencies":{"next":"^14.2.11","react":"^18.3.1","cryptr":"^6.3.0","cookies-next":"^4.2.1","class-validator":"^0.14.1","reflect-metadata":"^0.2.2","class-transformer":"^0.5.1","http-status-codes":"^2.3.0","@aslina/app-context":"^1.1.7","node-application-context":"^1.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsc":"^2.0.4","jest":"^29.7.0","eslint":"^9.10.0","rimraf":"^6.0.1","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.6.2","@types/jest":"^29.5.13","@types/node":"^22.5.4"},"_npmOperationalInternal":{"tmp":"tmp/next-app-router-decorator_1.0.7_1739303248913_0.4364837622178497","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@aslina/next-app-router-decorator","version":"1.0.8","description":"Nextjs API decorator helper","main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"test":"jest","build":"rimraf dist && tsc"},"repository":{"type":"git","url":"git+https://github.com/echaoeoen/next-api.git"},"keywords":["nextjs","api","handler","router","page-router"],"author":{"name":"echaoeoen","email":"echaoeoen@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/echaoeoen/next-api/issues"},"homepage":"https://github.com/echaoeoen/next-api#readme","dependencies":{"@aslina/app-context":"^1.1.7","class-transformer":"^0.5.1","class-validator":"^0.14.1","cookies-next":"^4.2.1","cryptr":"^6.3.0","http-status-codes":"^2.3.0","next":"^14.2.11","node-application-context":"^1.1.3","react":"^18.3.1","reflect-metadata":"^0.2.2"},"devDependencies":{"@types/jest":"^29.5.13","@types/node":"^22.5.4","eslint":"^9.10.0","jest":"^29.7.0","rimraf":"^6.0.1","ts-jest":"^29.2.5","ts-node":"^10.9.2","tsc":"^2.0.4","typescript":"^5.6.2"},"_id":"@aslina/next-app-router-decorator@1.0.8","gitHead":"3ef029a88c5e14bdd2ad5107544e22e3895c555c","_nodeVersion":"20.18.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-j31idxbXnxdroZTR4m9q01DoPwQe2Is3IHXrd1DobD4FdCHNI5wgvWQOSBkUz2QA5bv4iH2G4GCAINypIS66Yg==","shasum":"d44ff00e54c0881b1b30df4b9a0a1269a6319d9a","tarball":"https://registry.npmjs.org/@aslina/next-app-router-decorator/-/next-app-router-decorator-1.0.8.tgz","fileCount":69,"unpackedSize":170338,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDg77coF1vBzsNAFdwiLkI9JAGI3hv4IuFHJqYYspHqjQIhALq4bq97szl1xhv0ygm2pqnSIqcnNs/xo/X9JLO2zomL"}]},"_npmUser":{"name":"echaoeoen","email":"andyepso@gmail.com"},"directories":{},"maintainers":[{"name":"echaoeoen","email":"andyepso@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next-app-router-decorator_1.0.8_1739303666817_0.4421722599927236"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-11T18:18:09.767Z","modified":"2025-02-11T19:54:27.206Z","1.0.5":"2025-02-11T18:18:10.103Z","1.0.6":"2025-02-11T19:19:09.246Z","1.0.7":"2025-02-11T19:47:29.130Z","1.0.8":"2025-02-11T19:54:27.014Z"},"bugs":{"url":"https://github.com/echaoeoen/next-api/issues"},"author":{"name":"echaoeoen","email":"echaoeoen@gmail.com"},"license":"ISC","homepage":"https://github.com/echaoeoen/next-api#readme","keywords":["nextjs","api","handler","router","page-router"],"repository":{"type":"git","url":"git+https://github.com/echaoeoen/next-api.git"},"description":"Nextjs API decorator helper","maintainers":[{"name":"echaoeoen","email":"andyepso@gmail.com"}],"readme":"\n## Basic usage\n\n```ts\nimport { createHandler, Get } from '@aslina/next-app-router-decorator';\n\nclass UserHandler {\n  @Get()\n  public async users() {\n    return await UserService.findAll();\n  }\n}\n\nmodule.exports = createHandler(UserHandler);\n```\n\n## Introduction\n\nBuilding serverless functions declaratively with classes and decorators makes dealing with Next.js API routes easier and brings order and sanity to your `/app/path-to/route.ts` codebase.\n\nThe structure is heavily inspired by NestJS, which is an amazing framework for a lot of use cases. On the other hand, a separate NestJS repo for your backend can also bring unneeded overhead and complexity to projects with a smaller set of backend requirements. Combining the structure of NestJS, with the ease of use of Next.js, brings the best of both worlds for the right use case.\n\n## Installation\n\n```bash npm2yarn\nyarn install @aslina/next-app-router-decorator\n```\n\n### Using with SWC\n\nYour tsconfig.json needs the following flags in the `compilerOptions` section:\n\n```json5\n\"experimentalDecorators\": true,\n\"emitDecoratorMetadata\": true\n```\n\n### Using withBabel\n\nSince decorators are still in proposal state, you need to add the following plugins to your `devDependencies` in order to use them:\n\n```bash npm2yarn\nyarn add -D @babel/core babel-plugin-transform-typescript-metadata @babel/plugin-proposal-decorators babel-plugin-parameter-decorator\n```\n\nMake sure to add the following lines to the start of the `plugins` section in your babel configuration file:\n\n```json5\n{\n  \"plugins\": [\n    \"babel-plugin-transform-typescript-metadata\",\n    [\"@babel/plugin-proposal-decorators\", { \"legacy\": true }],\n    \"babel-plugin-parameter-decorator\",\n    // ... other plugins\n  ]\n}\n```\n\nYour tsconfig.json needs the following flag in the `compilerOptions` section:\n\n```json5\n\"experimentalDecorators\": true\n```\n\n# More\nYou can see more detailed usage of this library on [this] (https://github.com/echaoeoen/next-api/tree/main/readme)","readmeFilename":"readme.md"}