{"_id":"@api-craft/crud-router","_rev":"19-b463fb907f32efc316ab52de93d02d7f","name":"@api-craft/crud-router","dist-tags":{"latest":"2.3.2"},"versions":{"1.0.0":{"name":"@api-craft/crud-router","version":"1.0.0","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.0.0","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"f19f6658428517e736bfd5d9ec14ec31a1ea5563","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.0.0.tgz","fileCount":5,"integrity":"sha512-bK/pa3eprSvNcL9YkgBPYyEqUW9f4oQL3B3uJcwJdJkY1c7yruqOcx7p7o9peQeaRI3hwvY3hrCc0sVo4WIyAg==","signatures":[{"sig":"MEUCIQDPqErHK9uZfKqz+vS80YmP9AcuJzmgAMcLJvGtTM2PZAIgXMxLMf6tE858bee0IY1VG418YzOtjnXkpBLf2pLonwM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3967},"main":"index.js","type":"module","_from":"file:api-craft-crud-router-1.0.0.tgz","scripts":{"test":"vitest tests/","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\b4b30eb08a4ede4a39c19f0342a4e91b\\api-craft-crud-router-1.0.0.tgz","_integrity":"sha512-bK/pa3eprSvNcL9YkgBPYyEqUW9f4oQL3B3uJcwJdJkY1c7yruqOcx7p7o9peQeaRI3hwvY3hrCc0sVo4WIyAg==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.0.0_1750267949906_0.2682500518607651","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@api-craft/crud-router","version":"1.0.1","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.0.1","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"3262ea804f2dfefa4772517c27e7c2c5769a2b59","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.0.1.tgz","fileCount":5,"integrity":"sha512-UkOpZvbtWYHWlKZuruBujJJPU/JIy2YsOzmR9+thUQOdnXlq3xdJ7RBkqL58q4O0EE9ZW64g3ozZsLF+U9UOWQ==","signatures":[{"sig":"MEUCIC2g/tjax+tvwuzwuZ2R/Ln14m0lEkh2kAUKwSTrOqsWAiEA79sX3ntMvTrLSR+2jwy2CQyVeTOo4ciV6BFQ+eKFlAs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3973},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.0.1.tgz","scripts":{"test":"vitest tests/","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\bb21a0bed13d0be4981e3444617371bd\\api-craft-crud-router-1.0.1.tgz","_integrity":"sha512-UkOpZvbtWYHWlKZuruBujJJPU/JIy2YsOzmR9+thUQOdnXlq3xdJ7RBkqL58q4O0EE9ZW64g3ozZsLF+U9UOWQ==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.0.1_1750268569132_0.04502223940637018","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@api-craft/crud-router","version":"1.0.2","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.0.2","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"10a227b6318cf9467c5b717da77af7b69dc97515","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.0.2.tgz","fileCount":5,"integrity":"sha512-ujys5eT2I3j4FUxWLhyD23RLaIuwuNuRI7dQ6f79a1teGJmeQbsZPFP6E6xhJ1Siogvu3vOAv3XVuxT8xQGR7g==","signatures":[{"sig":"MEYCIQDaFa5ATAAGUzpNcAvxDhRi5eLEeIF5g5KXAkuOJzOQBgIhAKOmhFWYKhb3JbmQFbabhljF4OLoT834xcbyf/RmIHNT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3981},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.0.2.tgz","scripts":{"test":"vitest tests/","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\1b00624423c5e15cfd44d5b0b36dd834\\api-craft-crud-router-1.0.2.tgz","_integrity":"sha512-ujys5eT2I3j4FUxWLhyD23RLaIuwuNuRI7dQ6f79a1teGJmeQbsZPFP6E6xhJ1Siogvu3vOAv3XVuxT8xQGR7g==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.0.2_1750268798137_0.22042611557594705","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@api-craft/crud-router","version":"1.0.3","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.0.3","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"56f457113b4cdf2b4d496d0978a2fabdfa7298fd","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.0.3.tgz","fileCount":5,"integrity":"sha512-EAyCwENjKCSdsZ7ueDKQab2oGmvt/4v8FycGAE1eczsLwWJ0E57GBNFRcOzCR0jH07hnyBFa6CKILJZoQcPUGQ==","signatures":[{"sig":"MEUCIQD1M3zfosJ93PEe1HPsf/zSKY4TmNS9NHcye/hbdUwcMAIgK2InqcRPB6Ue5kKGhr0kxaNWH+CtQHnPDGU1u2Np09Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3986},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.0.3.tgz","scripts":{"test":"vitest tests/","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\83d1d1587f19038f76322d50ec8aab31\\api-craft-crud-router-1.0.3.tgz","_integrity":"sha512-EAyCwENjKCSdsZ7ueDKQab2oGmvt/4v8FycGAE1eczsLwWJ0E57GBNFRcOzCR0jH07hnyBFa6CKILJZoQcPUGQ==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.0.3_1750269122238_0.6312734810885252","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@api-craft/crud-router","version":"1.0.4","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.0.4","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"c98edadcf74738d97ba0db9892bba30f2841411e","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.0.4.tgz","fileCount":5,"integrity":"sha512-/0IO75Nqnut8AM/QvMPYX9g2nFKhbWgif7dBRpccLVBrudYaBU5q71wbSbiGttRnw4i5oxkgbki5WIyt+koQDg==","signatures":[{"sig":"MEUCIQD31ZSCcLycUB/TPcQwn9Ao+lyWMorjH9SikpwmCyW5hQIgT2txK6WqAIv6xxy1vFAOEvST/4BVWSl6NyakSf6eulE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3980},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.0.4.tgz","scripts":{"test":"vitest tests/","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\cfe3f6debbefdf49f832b10126912380\\api-craft-crud-router-1.0.4.tgz","_integrity":"sha512-/0IO75Nqnut8AM/QvMPYX9g2nFKhbWgif7dBRpccLVBrudYaBU5q71wbSbiGttRnw4i5oxkgbki5WIyt+koQDg==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.0.4_1750269229033_0.373736294135635","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@api-craft/crud-router","version":"1.1.0","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.1.0","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"9080b7e7f6aec306c46aac103dfc5116ca8d82ef","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.1.0.tgz","fileCount":6,"integrity":"sha512-R+ArAVoV4cvfcBqSi8qHzM71duClFHyoLmLyfXLMnC7s/aB/Rpn6LjljBHUMQLPzrwLmnHCz8eCwHR5SSDBt4A==","signatures":[{"sig":"MEUCIQDueRC7jRAOOl2CWyvWg4sh+oWEtGfA33RZtOeyNjuq7gIgHdOIdmoeK2OYeAETQSkVyXmBq8l27ugFaVdtlVlG0Fo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10031},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.1.0.tgz","scripts":{"test":"npx vitest run --reporter verbose","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\b31bcabead7c7b9fe0cf722358f55642\\api-craft-crud-router-1.1.0.tgz","_integrity":"sha512-R+ArAVoV4cvfcBqSi8qHzM71duClFHyoLmLyfXLMnC7s/aB/Rpn6LjljBHUMQLPzrwLmnHCz8eCwHR5SSDBt4A==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","vitest":"^3.2.4","supertest":"^7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.1.0_1750305296855_0.9997006213212702","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@api-craft/crud-router","version":"1.1.1","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.1.1","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"aec8b565da0017b1e30312193fe81b78cc028259","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.1.1.tgz","fileCount":6,"integrity":"sha512-wewNhY/GRL38SqGicEPO0ltujv9sWm7ZUfXaEHsF5LcG0K/wgOFw7bg3o3VUjs5tVv1HWp+WVkixYR0aNt6ZuQ==","signatures":[{"sig":"MEUCIEqbBu0AaLGsVdIgEzIy6hoBxEPVEr99FIvFcMB2lCIGAiEAtM2tR43VCfwf/JTo+H78QcVpise354eRniLWkQagvHY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10034},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.1.1.tgz","scripts":{"test":"npx vitest run --reporter verbose","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\0fa82becfb7131c8072c367243977daa\\api-craft-crud-router-1.1.1.tgz","_integrity":"sha512-wewNhY/GRL38SqGicEPO0ltujv9sWm7ZUfXaEHsF5LcG0K/wgOFw7bg3o3VUjs5tVv1HWp+WVkixYR0aNt6ZuQ==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","vitest":"^3.2.4","supertest":"^7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.1.1_1750305632780_0.33391050722530435","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@api-craft/crud-router","version":"1.1.2","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@1.1.2","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"f98aad543fbb94aa3a268f3fbee6d1c3d6740120","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-1.1.2.tgz","fileCount":6,"integrity":"sha512-CMElWHnCU1VkjuA+iy7FsYVgYpSVwmi0KV3OqoxTlylNZ0hSkhfZxCngBdQNIUvn9NHKuwK3QZB8YcMjvksypQ==","signatures":[{"sig":"MEUCIQC1wXBv5AjgqUm83e14oh33HXgpXLSHBUU/q7SsNnMJkwIgWHj7TwL8RzwCJBjLPlthdggLPLwty3OWcofh+0zavvU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10158},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-1.1.2.tgz","scripts":{"test":"npx vitest run --reporter verbose","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\503c9b471afa9196899ee1c45137fb69\\api-craft-crud-router-1.1.2.tgz","_integrity":"sha512-CMElWHnCU1VkjuA+iy7FsYVgYpSVwmi0KV3OqoxTlylNZ0hSkhfZxCngBdQNIUvn9NHKuwK3QZB8YcMjvksypQ==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","vitest":"^3.2.4","supertest":"^7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_1.1.2_1750491462324_0.17076445289260356","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@api-craft/crud-router","version":"2.0.0","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.0.0","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"1349b5aedd698740880c76770faf0edabe2ca34d","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.0.0.tgz","fileCount":6,"integrity":"sha512-krNMDjEZvFEm31FKOGVjaww9ClDFmeB46jVvgIodPXchZHNahB97K/f70CJ2kM4tZvECARNcv6yokEiRCN9oVA==","signatures":[{"sig":"MEQCIFSJ/+5K0dH9A363WPRdqFbywxD6s0GISVVwoiogSLGLAiB4LjJwyc3is1rYnEZTbW7GzXikFC9mf6m5NlBWCEcLvw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12805},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.0.0.tgz","scripts":{"test":"npx vitest run --reporter verbose","build":"tsc"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\9a75927b1a20553bd3e5b0a82d442bed\\api-craft-crud-router-2.0.0.tgz","_integrity":"sha512-krNMDjEZvFEm31FKOGVjaww9ClDFmeB46jVvgIodPXchZHNahB97K/f70CJ2kM4tZvECARNcv6yokEiRCN9oVA==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","vitest":"^3.2.4","supertest":"^7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.0.0_1750779205363_0.8085515217684773","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@api-craft/crud-router","version":"2.1.1","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.1.1","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"c89bcb8b0fa349050eec427246552a2667cee62d","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.1.1.tgz","fileCount":13,"integrity":"sha512-XkDA+bYIaIwr+R0iDulXOYB3QGH5Kxtatu7zB4cO7dTVzHaE21QNyRbOmU13NEgqFEkFwLhQW9WHLOg7PiI03Q==","signatures":[{"sig":"MEUCIAiflQ3URCM2G8rydcGRdbDlrc4d5oEFEvqPLaFEJ1apAiEAwcPoWyATbypwM5MbsHGdF/qO3z3lOFTmg6WGAYEdimU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22219},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.1.1.tgz","scripts":{"lint":"eslint .","test":"npx vitest run --reporter verbose","test:live":"node ./tests/live/index.js"},"_npmUser":{"name":"tselven_me","actor":{"name":"tselven_me","type":"user","email":"tselven13@gmail.com"},"email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\92962a3fd0b9133f8e5df0f9388831c6\\api-craft-crud-router-2.1.1.tgz","_integrity":"sha512-XkDA+bYIaIwr+R0iDulXOYB3QGH5Kxtatu7zB4cO7dTVzHaE21QNyRbOmU13NEgqFEkFwLhQW9WHLOg7PiI03Q==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.1.1_1751171808169_0.9576084777427929","host":"s3://npm-registry-packages-npm-production"}},"2.1.2":{"name":"@api-craft/crud-router","version":"2.1.2","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.1.2","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"e92158ac69423ece83d3f52d64101cb4071a2250","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.1.2.tgz","fileCount":15,"integrity":"sha512-VvaCRMOSDwBmoRpQWq4fhBEYAOFmrgS8t0Qha47Uxs7JYzkvaLbiLrz4PA9TOTHsGU0Z+mu7OkTshvEUv4oyug==","signatures":[{"sig":"MEQCIDc32hAQ3EC9Q4DeTPM/5hTbqZr3r7yzQKXBPdpLI9sBAiAnN6blY5Oto/BF/zTUfFabfuKROATqxtqqgMTCVjmaow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23508},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.1.2.tgz","scripts":{"lint":"eslint .","test":"bun test","test:live":"bun run ./tests/live/index.js","test:unit":"bun test tests/unit ","test:feature":"bun test tests/feature "},"_npmUser":{"name":"tselven_me","email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\43381b4fa589fee095ebf0e904488e94\\api-craft-crud-router-2.1.2.tgz","_integrity":"sha512-VvaCRMOSDwBmoRpQWq4fhBEYAOFmrgS8t0Qha47Uxs7JYzkvaLbiLrz4PA9TOTHsGU0Z+mu7OkTshvEUv4oyug==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.1.2_1754319206054_0.5833192869454717","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@api-craft/crud-router","version":"2.2.0","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.2.0","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"b5bb01874853542e841a11166f5a029577d34d57","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.2.0.tgz","fileCount":13,"integrity":"sha512-KRPPacIbdvi3xOBcI63eL4YLYBH9BpYyfbd/6OEAeQRknVP60sQrIPBhEjUNOGN4rpaDQrO7+pnxyNuEwIvueA==","signatures":[{"sig":"MEQCID3ZqV63UJ1wyoEp52NdHq5w1oG0yKp932l6Ox9w9Xn7AiBtkUXb5ahKka5PTWOFemH3gLkLWQYasIEdT1dU5up7Qg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23682},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.2.0.tgz","scripts":{"lint":"eslint .","test":"bun test","test:live":"bun run ./tests/live/index.js","test:unit":"bun test tests/unit ","test:feature":"bun test tests/feature "},"_npmUser":{"name":"tselven_me","email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\ece7344fda3fce991bc0867cdff23678\\api-craft-crud-router-2.2.0.tgz","_integrity":"sha512-KRPPacIbdvi3xOBcI63eL4YLYBH9BpYyfbd/6OEAeQRknVP60sQrIPBhEjUNOGN4rpaDQrO7+pnxyNuEwIvueA==","deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer.","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.2.0_1757763342328_0.030341681598174297","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@api-craft/crud-router","version":"2.3.0","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.3.0","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"15becc4ca877a262da47ed5374d7daf2a4bcf530","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.3.0.tgz","fileCount":15,"integrity":"sha512-CCTlQfMXB2e9tQUdRcO1NzPnRMuh4UbRaiH9fiScoOXoPvlSl5U/JiibVoOLvInk/j0NGZLffAaIEa0cpMjApw==","signatures":[{"sig":"MEUCIHhxyGa82ksPZjwCqra2dWbDKFv58BPKQhAL+xSeCRQIAiEA0gHIw78xJs99+X37Cy+LKi8oBnXcGE8iZ9VZEgTNsGU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28200},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.3.0.tgz","scripts":{"lint":"eslint .","test":"bun test","test:live":"bun run ./tests/live/index.js","test:unit":"bun test tests/unit ","test:feature":"bun test tests/feature "},"_npmUser":{"name":"tselven_me","email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\ff112c0cd2dafbd350ba7846ecb02a3c\\api-craft-crud-router-2.3.0.tgz","_integrity":"sha512-CCTlQfMXB2e9tQUdRcO1NzPnRMuh4UbRaiH9fiScoOXoPvlSl5U/JiibVoOLvInk/j0NGZLffAaIEa0cpMjApw==","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","js-yaml":"^4.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.3.0_1761293746656_0.2965093399380725","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer."},"2.3.1":{"name":"@api-craft/crud-router","version":"2.3.1","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.3.1","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"05c7e5dfa559f78d394b173c2bb356ecb90d8db5","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.3.1.tgz","fileCount":15,"integrity":"sha512-rjgr+/yVZ++A4Cb+/rceWxCLosA34EWVVmgagc9NDI1NbGnFRN+tTH5s/9sXh3tpcakmGYg7meSiX6V1DXoJbA==","signatures":[{"sig":"MEUCIQDLhntrT+WM9/QNZpP97WdTOlGvR7zCltAsn6k0q8k4IgIgVBkA18UnVUC6ZYXDTHFDyYF9GsMPBy55yjkl1iwU0QE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30975},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.3.1.tgz","scripts":{"lint":"eslint .","test":"bun test","test:live":"bun run ./tests/live/index.js","test:unit":"bun test tests/unit ","test:feature":"bun test tests/feature "},"_npmUser":{"name":"tselven_me","email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\f3bbf134257d2d3eb58a93e1d2071732\\api-craft-crud-router-2.3.1.tgz","_integrity":"sha512-rjgr+/yVZ++A4Cb+/rceWxCLosA34EWVVmgagc9NDI1NbGnFRN+tTH5s/9sXh3tpcakmGYg7meSiX6V1DXoJbA==","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","js-yaml":"^4.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.3.1_1761296651860_0.9683831226397712","host":"s3://npm-registry-packages-npm-production"},"deprecated":"This version is deprecated. Please upgrade to version 2.3.2 or newer."},"2.3.2":{"name":"@api-craft/crud-router","version":"2.3.2","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"author":{"name":"P.Thamilselven"},"license":"MIT","_id":"@api-craft/crud-router@2.3.2","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"homepage":"https://github.com/api-craft/crud-router#readme","bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"dist":{"shasum":"2383103a8ead4337825b27e0e16ca33d3a630c38","tarball":"https://registry.npmjs.org/@api-craft/crud-router/-/crud-router-2.3.2.tgz","fileCount":15,"integrity":"sha512-p732BWo7hCLtokFvr1WPgzqI9SH+RpNL5U7HxdCu/sN0J/+HL/1o53VMLYjQMY9CukzeW/V6makFXLLAskHiGw==","signatures":[{"sig":"MEQCIDXWruQTpi+KkFgzLH6waNRGMxONgnIYoeYJcTm0FEaIAiB0BFjFr6jWUs8YKdpZtJcSgMWrQHhQVquf1Yqn75fZHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38645},"main":"./src/index.js","type":"module","_from":"file:api-craft-crud-router-2.3.2.tgz","scripts":{"lint":"eslint .","test":"bun test","test:live":"bun run ./tests/live/index.js","test:unit":"bun test tests/unit ","test:feature":"bun test tests/feature "},"_npmUser":{"name":"tselven_me","email":"tselven13@gmail.com"},"_resolved":"C:\\Users\\DELL\\AppData\\Local\\Temp\\ef4757fb21951d7e09fbf48d90afbee4\\api-craft-crud-router-2.3.2.tgz","_integrity":"sha512-p732BWo7hCLtokFvr1WPgzqI9SH+RpNL5U7HxdCu/sN0J/+HL/1o53VMLYjQMY9CukzeW/V6makFXLLAskHiGw==","repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"_npmVersion":"10.9.2","description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"express":"^5.1.0","js-yaml":"^4.1.0","mongoose":"^8.16.0"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.5.0","eslint":"^9.29.0","vitest":"^3.2.4","globals":"^16.2.0","supertest":"^7.1.1","@eslint/js":"^9.29.0"},"_npmOperationalInternal":{"tmp":"tmp/crud-router_2.3.2_1761321347421_0.594169916734234","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-18T17:32:29.800Z","modified":"2025-10-24T15:56:30.718Z","1.0.0":"2025-06-18T17:32:30.108Z","1.0.1":"2025-06-18T17:42:49.298Z","1.0.2":"2025-06-18T17:46:38.333Z","1.0.3":"2025-06-18T17:52:02.438Z","1.0.4":"2025-06-18T17:53:49.210Z","1.1.0":"2025-06-19T03:54:57.026Z","1.1.1":"2025-06-19T04:00:32.978Z","1.1.2":"2025-06-21T07:37:42.514Z","2.0.0":"2025-06-24T15:33:25.542Z","2.1.0":"2025-06-29T04:10:32.813Z","2.1.1":"2025-06-29T04:36:48.389Z","2.1.2":"2025-08-04T14:53:26.228Z","2.2.0":"2025-09-13T11:35:42.535Z","2.3.0":"2025-10-24T08:15:46.866Z","2.3.1":"2025-10-24T09:04:12.048Z","2.3.2":"2025-10-24T15:55:47.613Z"},"bugs":{"url":"https://github.com/api-craft/crud-router/issues"},"author":{"name":"P.Thamilselven"},"license":"MIT","homepage":"https://github.com/api-craft/crud-router#readme","keywords":["express","mongoose","crud","api","router","rest","nodejs","backend","automation","generate","middleware","javascript","typescript"],"repository":{"url":"git+https://github.com/api-craft/crud-router.git","type":"git"},"description":"A lightweight Express middleware to automatically generate CRUD routes and controllers from Mongoose models, simplifying API development.","maintainers":[{"name":"tselven_me","email":"tselven13@gmail.com"}],"readme":"﻿﻿# CRUD ROUTER\r\n\r\n![NPM Downloads](https://img.shields.io/npm/dy/%40api-craft%2Fcrud-router?logo=npm)\r\n![NPM Downloads](https://img.shields.io/npm/dm/%40api-craft%2Fcrud-router?logo=npm)\r\n![GitHub Repo stars](https://img.shields.io/github/stars/api-craft/crud-router?style=flat&logo=github)\r\n![GitHub Release](https://img.shields.io/github/v/release/api-craft/crud-router)\r\n![GitHub contributors](https://img.shields.io/github/contributors/api-craft/crud-router?logo=github&color=green)\r\n\r\n\r\nA flexible and customizable CRUD router generator for Express.js and Mongoose, designed to speed up API development with powerful filtering, pagination, bulk actions, projection, populate, and middleware support.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- **Automatic CRUD routes**: `getAll`, `getById`, `create`, `update`, and `remove` for any Mongoose model.\r\n- **Auto-Expose API**: Automatically scan and expose CRUD endpoints from your models directory using `craft.yml` or `craft.json` configuration.\r\n- **Bulk Action**: `bulkUpdate`, `bulkDelete`, `bulkCreate` actions are supported.\r\n- **Exclude routes**: Easily exclude any CRUD method when generating the router.\r\n- **Lifecycle hooks**: Attach hooks for `beforeGetAll`, `afterGetAll`, `beforeGetById`, `afterGetById`, `beforeCreate`, `afterCreate`, `beforeUpdate`, `afterUpdate`, `beforeDelete`, and `afterDelete`.\r\n- **Query parsing**: Support MongoDB-style filtering via URL query parameters with operators like:\r\n  - `gt` (greater than)\r\n  - `gte` (greater than or equal)\r\n  - `lt` (less than)\r\n  - `lte` (less than or equal)\r\n  - `ne` (not equal)\r\n  - `in` (array inclusion)\r\n- **Pagination**: Use `limit` and `page` query parameters for paginated results.\r\n- **Custom middleware**: Apply middleware functions selectively per CRUD route (e.g., middleware only for `getAll` or `delete`).\r\n- **Populate support**: Use `?populate=user,category` to populate references on any route.\r\n- **Projection support**: Use `?fields=name,price` to return only specific fields, with the ability to hide sensitive fields by default.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @api-craft/crud-router\r\n```\r\n\r\nor with pnpm:\r\n\r\n```bash\r\npnpm add @api-craft/crud-router\r\n```\r\n\r\n---\r\n\r\n## Usage\r\n\r\n> **💡 Important:** When using `autoExposeFromCraft`, always pass your mongoose instance (see [Using Your Mongoose Instance](#using-your-mongoose-instance-recommended)) to avoid version conflicts.\r\n\r\n### Manual Router Setup\r\n\r\n```js\r\nimport express from 'express';\r\nimport mongoose from 'mongoose';\r\nimport { createCrud } from '@api-craft/crud-router';\r\n\r\nconst app = express();\r\napp.use(express.json());\r\n\r\nconst productSchema = new mongoose.Schema({\r\n  name: String,\r\n  price: Number,\r\n  category: { type: mongoose.Schema.Types.ObjectId, ref: 'Category' },\r\n});\r\n\r\nconst Product = mongoose.model('Product', productSchema);\r\n\r\nconst productRouter = createCrud(Product, {\r\n  excluded: ['remove'], // Exclude single delete if needed\r\n  hooks: {\r\n    beforeCreate: async (data) => {\r\n      // Modify data before creation\r\n      return data;\r\n    },\r\n  },\r\n  middlewares: {\r\n    getAll: [(req, res, next) => {\r\n      console.log('Middleware for getAll route');\r\n      next();\r\n    }],\r\n  },\r\n  hide: {\r\n    getAll: ['internalCode'], // Example: Hide sensitive field from responses\r\n  },\r\n});\r\n\r\napp.use('/api/products', productRouter);\r\n\r\napp.listen(3000, () => {\r\n  console.log('Server running on port 3000');\r\n});\r\n```\r\n\r\n### Auto-Expose API from Models Directory\r\n\r\nAutomatically generate and mount CRUD routes for all models in a directory using configuration:\r\n\r\n**1. Install js-yaml** (if using YAML config):\r\n```bash\r\npnpm add js-yaml\r\n```\r\n\r\n**2. Create `craft.yml` or `craft.json`** in your project root:\r\n\r\n```yaml\r\n# craft.yml\r\nbasePath: /api\r\nmodelsDir: ./models\r\n\r\nignore:\r\n  - InternalAudit\r\n\r\nfilesIgnore:\r\n  - index.js\r\n  - README.md\r\n\r\nroutes:\r\n  Product:\r\n    path: /products\r\n    excluded: [remove]\r\n    hide:\r\n      getAll: [internalCode]\r\n      getOne: [internalCode]\r\n  User:\r\n    path: /users\r\n    excluded: [create, remove]\r\n```\r\n\r\nOr using JSON:\r\n\r\n```json\r\n{\r\n  \"basePath\": \"/api\",\r\n  \"modelsDir\": \"./models\",\r\n  \"ignore\": [\"InternalAudit\"],\r\n  \"filesIgnore\": [\"index.js\"],\r\n  \"routes\": {\r\n    \"Product\": {\r\n      \"path\": \"/products\",\r\n      \"excluded\": [\"remove\"],\r\n      \"hide\": {\r\n        \"getAll\": [\"internalCode\"]\r\n      }\r\n    },\r\n    \"User\": {\r\n      \"path\": \"/users\",\r\n      \"excluded\": [\"create\", \"remove\"]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n**3. Use autoExposeFromCraft** in your server:\r\n\r\n```js\r\nimport express from 'express';\r\nimport mongoose from 'mongoose';\r\nimport { autoExposeFromCraft } from '@api-craft/crud-router';\r\n\r\nconst app = express();\r\napp.use(express.json());\r\n\r\nawait mongoose.connect(process.env.MONGO_URI);\r\n\r\n// RECOMMENDED: Pass your mongoose instance to avoid version conflicts\r\nawait autoExposeFromCraft(app, { mongoose });\r\n\r\napp.listen(3000, () => {\r\n  console.log('Server running on port 3000');\r\n});\r\n```\r\n\r\n> **💡 Best Practice:** Always pass your mongoose instance via `{ mongoose }` or `{ connection }` to avoid conflicts between different mongoose versions in your node_modules tree.\r\n\r\n**Configuration Options:**\r\n\r\n- `basePath`: Base path for all routes (default: `/api`)\r\n- `modelsDir`: Directory containing model files (default: `./models`)\r\n- `ignore`: Array of model names to skip\r\n- `filesIgnore`: Array of filenames to skip during import\r\n- `routes.[ModelName].path`: Custom path for model (default: kebab-case pluralized model name)\r\n- `routes.[ModelName].excluded`: Array of methods to exclude (`getAll`, `getById`, `create`, `update`, `remove`, `updateBulk`, `removeBulk`)\r\n- `routes.[ModelName].hide`: Object with `getAll` and `getOne` arrays of fields to hide\r\n\r\n---\r\n\r\n### Supported Model Export Patterns\r\n\r\nThe auto-expose feature intelligently handles various export patterns:\r\n\r\n**Default Export - Model:**\r\n```js\r\n// User.js or user.model.js\r\nimport mongoose from 'mongoose';\r\nconst schema = new mongoose.Schema({ name: String });\r\nexport default mongoose.model('User', schema);\r\n```\r\n\r\n**Default Export - Schema:**\r\n```js\r\n// Product.js or product.model.js\r\nimport mongoose from 'mongoose';\r\nexport default new mongoose.Schema({ name: String, price: Number });\r\n// Model name inferred from filename: Product\r\n```\r\n\r\n**Named Export - Model:**\r\n```js\r\n// category.model.js\r\nimport mongoose from 'mongoose';\r\nconst schema = new mongoose.Schema({ title: String });\r\nexport const Category = mongoose.model('Category', schema);\r\n```\r\n\r\n**Named Export - Schema:**\r\n```js\r\n// tag.model.js\r\nimport mongoose from 'mongoose';\r\nexport const TagSchema = new mongoose.Schema({ label: String });\r\n// Model name inferred from filename: Tag\r\n```\r\n\r\n**Mixed Exports:**\r\n```js\r\n// Order.js\r\nimport mongoose from 'mongoose';\r\nconst OrderSchema = new mongoose.Schema({ total: Number });\r\nconst Order = mongoose.model('Order', OrderSchema);\r\nexport default Order;\r\nexport { OrderSchema }; // Also exported for reuse\r\n```\r\n\r\n**Grouped Exports:**\r\n```js\r\n// index.js\r\nimport User from './User.js';\r\nimport Product from './Product.js';\r\nexport const models = { User, Product };\r\n```\r\n\r\n**Factory Functions:**\r\n```js\r\n// Multi-tenant pattern\r\nexport default (connection) => {\r\n  const schema = new connection.Schema({ name: String });\r\n  return connection.model('Tenant', schema);\r\n};\r\n```\r\n\r\n**File Naming Conventions:**\r\n- `User.js`, `user.js` → Model name: `User`\r\n- `user.model.js`, `UserModel.js` → Model name: `User`\r\n- `user.schema.js`, `user-schema.js` → Model name: `User`\r\n- The suffix `.model`, `.schema`, `.entity`, `.collection` is automatically removed\r\n\r\n---\r\n\r\n### Using Your Mongoose Instance (Recommended)\r\n\r\n**Why pass your mongoose instance?**\r\n- ✅ Avoids mongoose version conflicts between your app and node_modules\r\n- ✅ Ensures models are registered on the same connection instance\r\n- ✅ Prevents \"Schema hasn't been registered\" errors\r\n- ✅ Required for multi-tenant or multi-database setups\r\n\r\n```js\r\nimport mongoose from 'mongoose';\r\nimport { autoExposeFromCraft } from '@api-craft/crud-router';\r\n\r\n// Method 1: Pass mongoose instance (RECOMMENDED)\r\nawait mongoose.connect(process.env.MONGO_URI);\r\nawait autoExposeFromCraft(app, { mongoose });\r\n\r\n// Method 2: Pass specific connection (multi-tenant setups)\r\nconst tenantConn = await mongoose.createConnection(process.env.TENANT_DB_URI);\r\nawait autoExposeFromCraft(app, { \r\n  connection: tenantConn,\r\n  mountBase: '/api/tenant'\r\n});\r\n\r\n// Method 3: Store in app locals (alternative)\r\napp.locals.mongoose = mongoose;\r\nawait autoExposeFromCraft(app); // Will use app.locals.mongoose.connection\r\n\r\n// Method 4: Using app.set (Express pattern)\r\napp.set('mongoose', mongoose);\r\nawait autoExposeFromCraft(app); // Will use app.get('mongoose').connection\r\n```\r\n\r\n**Connection Resolution Priority:**\r\n1. `opts.connection` (direct connection object)\r\n2. `opts.mongoose.connection` (mongoose instance)\r\n3. `app.locals.mongoose.connection` (stored in app locals)\r\n4. `app.get('mongoose').connection` (stored in app settings)\r\n5. `mongoose.connection` (global fallback - not recommended)\r\n\r\n---\r\n\r\n## API Response Format\r\n\r\nAll `getAll` endpoints return data in the following format:\r\n\r\n```json\r\n{\r\n  \"data\": [...],\r\n  \"meta\": {\r\n    \"total\": 100,\r\n    \"limit\": 10,\r\n    \"currentPage\": 2,\r\n    \"totalPages\": 10,\r\n    \"hasNextPage\": true,\r\n    \"hasPrevPage\": true\r\n  }\r\n}\r\n```\r\n\r\nWhen pagination parameters (`limit` and `page`) are not provided, `meta.pagination` will be `false` and only `total` is included.\r\n\r\n---\r\n\r\n## Example Query Features\r\n\r\n- Pagination: `/api/products?limit=10&page=2`\r\n- Filtering: `/api/products?price=gt-100`\r\n- Field Selection (Projection): `/api/products?fields=name,price`\r\n- Populate Related Data: `/api/products?populate=category`\r\n\r\n---\r\n## Author\r\nDeveloped and Maintained by [@tselven](https://github.com/tselven)\r\n\r\n## Contributors\r\n\r\n<div style=\"display: flex; flex-wrap: wrap; align-items: center; gap: 20px;\">\r\n  <a href=\"https://github.com/tselven\" style=\"text-align: center; text-decoration: none;\">\r\n    <img src=\"https://avatars.githubusercontent.com/tselven\" width=\"60\" style=\"border-radius: 50%;\" alt=\"@tselven\" />\r\n    <div><sub><b>@tselven</b></sub></div>\r\n  </a>\r\n  <!-- Add more contributors here in same format -->\r\n</div>\r\n\r\n\r\n---\r\n## Contributions\r\n\r\nContributions are welcome for:\r\n- Impliment new drivers and extend the functionalities\r\n- Create and Maintain Docs Pages\r\n- Bug Fix and Code Quality Maintanence.\r\n","readmeFilename":"README.md"}