{"_id":"@anhkhoakz/mongoose-to-json","_rev":"8-c524c2c52f2a7051313b858f14f1ae74","name":"@anhkhoakz/mongoose-to-json","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.0":{"name":"@anhkhoakz/mongoose-to-json","version":"1.0.0","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.0.0","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"06a33d3399c8cb85101065be412d5327a02a67c5","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.0.0.tgz","fileCount":7,"integrity":"sha512-Kc/qgdbfU++MMpQ7CtluhX2eDb0AnbsuyCdVMzlcjsHk8nsGbTAZipME+3AB3c0Iovq2BrveAkvBnm7qZoFZJA==","signatures":[{"sig":"MEYCIQDg/FV9hN6pqwZ735YbEN8mHwRa3FDzKJC1Dt8Ysd6urQIhAM+a51QpRtZb324NJUgJbLsIoa6Z3htToSaSIqfJ+ZH+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50760},"main":"index.ts","type":"module","module":"index.ts","gitHead":"97f08d61dab1dc868bdcafc82ba3b5a7b600ed2f","scripts":{"build":"bun build index.ts --target node --outdir dist --minify","postversion":"git push && bun publish"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"mongoose":"^8","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.0.0_1756869127752_0.1282023801186134","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@anhkhoakz/mongoose-to-json","version":"1.0.1","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.0.1","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"f3165b3ad7672b82f6d95719501aa6c0e4fb2dfb","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.0.1.tgz","fileCount":5,"integrity":"sha512-lvvYuvZcSzVO7LPcvp/H6NSMt4aojEU2RY/hgXOHmJ9i+xPPMGB/jRjcZA9H4InKii5Q4FPAU7s90sNjvs7/8g==","signatures":[{"sig":"MEUCIEfOl3ujKmMckzaiEduvRpmxLxlmPzb3aCWpi2o1sQ48AiEAj54Q78f3DyTxwQTPR4Bmo2m5UlJEvJy1xAFG9vmabr0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42320},"main":"index.ts","type":"module","module":"index.ts","gitHead":"90425efe231527c9450fc4f40b8d7afb90ba801a","scripts":{"build":"bun build index.ts --target node --outdir dist --minify","postversion":"git push && npm publish"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"mongoose":"^8","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.0.1_1756884399103_0.3886106990862852","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@anhkhoakz/mongoose-to-json","version":"1.0.2","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.0.2","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"28e19b93d3bc82f4f3d895fca443d137a698f5bd","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.0.2.tgz","fileCount":5,"integrity":"sha512-8vxVkHOMbKafkMZo6Mm8hw4mYx0v+SaHTJCuyYhxgOMyltdNhv5xXdzvK/zlUtWFC3ZVAdyzvXACKlgQUv8haw==","signatures":[{"sig":"MEUCIQDPo7NQ9yTg0mR8th1A07hx/UMyb5BrNH4M8iYS9yqYaQIga6Hc2jPvgMzq2aBHTBFVFgsbv/dyWOM/UP4jdOvMWww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40944},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f10c7e8ea612a61dc9e0ba15c12e6045268ce03c","scripts":{"build":"bun build index.ts --target node --outdir dist --minify","types":"bun x tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist","release":"git push && bun publish","prepublishOnly":"rm -rf dist && bun run build && bun run types"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"mongoose":"^8","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.0.2_1756885051708_0.1890871060431878","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@anhkhoakz/mongoose-to-json","version":"1.1.0","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.1.0","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"44cd6a1e10c6d54aa8c4dfee69d778e5748ae677","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.1.0.tgz","fileCount":5,"integrity":"sha512-smCLgIcL13cb0gFm8OoYDUCYNxbJMiulntjsIDHxSCMCaNqohLMqt7LuQjYv0f6Q11DofU97FAhWim8w5BctzA==","signatures":[{"sig":"MEYCIQCWb2Q/OLO0PWGvsxFwtd7iEMpCobI7sMjUwhwlLKzZuAIhANN/9E8N+ZZWwSt5rm93TNM2HrY/Da1A4nwZWpQxhQCh","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40980},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"0491b72e2faed76321c97b112b22083c4be7af76","scripts":{"test":"bun test","build":"bun build index.ts --target node --outdir dist --minify","types":"bun x tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist","release":"git push && npm publish","prepublishOnly":"rm -rf dist && bun run build && bun run types"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"_nodeVersion":"24.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"mongoose":"^8","typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.1.0_1756885803050_0.12931735544646483","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@anhkhoakz/mongoose-to-json","version":"1.2.0","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.2.0","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"da6ad1d191854ca01de46574aa0b94119b4620dd","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.2.0.tgz","fileCount":7,"integrity":"sha512-o25XhLzpzqCcKpouFegoLTc7wc+QFboztcxeIvxWn22/IB5VyIzCma+QmxmKKSgEZn3SLX6YWsA25qivxvc+ug==","signatures":[{"sig":"MEQCIAr0QtQY+CpFAQfHdNl+DL3khJzgByNroeGz5Bem4tHGAiB5lm63n5rKUE1m/sqz1Aso9McDlWsLu65EDO5+bL/ovQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47794},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"09918e6fc2672b638fb9f7f2d91d61de11eb9432","scripts":{"lint":"bun x tsc --noEmit","test":"bun test","build":"bun build src/index.ts --target node --outdir dist --minify --sourcemap","clean":"rm -rf dist","types":"bun x tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false --outDir dist","release":"git push && npm publish","test:coverage":"bun test --coverage","prepublishOnly":"rm -rf dist && bun run build && bun run types"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"sideEffects":false,"_nodeVersion":"24.7.0","publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"peerDependencies":{"mongoose":"^8"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.2.0_1756958294845_0.29247366716518","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@anhkhoakz/mongoose-to-json","version":"1.2.1","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://git.sr.ht/~anhkhoakz","name":"anhkhoakz"},"license":"AGPL-3.0-only","_id":"@anhkhoakz/mongoose-to-json@1.2.1","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"383e7f10ab21fd6f3a9f67ea973e2869859e5d1b","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.2.1.tgz","fileCount":5,"integrity":"sha512-XUOAtCEArJ30Xpu8P/9vpYORIqr5Zl9iiZdcdBYx2xQg71u1zaV3/ksSPY2AyRwUOx3x27AgT1unHf/lUiVmZg==","signatures":[{"sig":"MEUCIQDWsKCBFSoFkUEsVXE4QuIelz4L9IMXxB2Au0el7OuDDwIgSiEAAA87N5jnEE3KbNyxtarrmu+4RzODuv5x1Ed7pn0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41856},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"e6ee5284b5b460e9892a58c92e904feac1900486","scripts":{"lint":"bun x tsc --noEmit","test":"bun test","build":"bun build src/index.ts --target node --outdir dist --minify --sourcemap","clean":"rm -rf dist","types":"bun x tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false --outDir dist","release":"git push && npm publish","test:coverage":"bun test --coverage","prepublishOnly":"rm -rf dist && bun run build && bun run types"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"sideEffects":false,"_nodeVersion":"24.7.0","publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"peerDependencies":{"mongoose":"^8"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.2.1_1757659019645_0.7586472555515211","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"name":"@anhkhoakz/mongoose-to-json","version":"1.2.2","keywords":["mongoose","plugin","toJSON","json"],"author":{"url":"https://www.anhkhoakz.dev/","name":"anhkhoakz"},"license":"Apache-2.0","_id":"@anhkhoakz/mongoose-to-json@1.2.2","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","dist":{"shasum":"739d453050577178b903fab76f4f0c4a90d395d5","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.2.2.tgz","fileCount":5,"integrity":"sha512-Op+QqfcbUaqQsgr4642Db9MtyojC4QXgrZsjaIxCZfjtFOFbqI3ZaNetHa3VsCFtW6XT+9NbCASyhX8+HuMVaA==","signatures":[{"sig":"MEUCIQDSBXGMz+Kiy2iPMmxwZJnCbGOE2VZi12wPcapjiFeP8gIgMQBS0aPkrET9feRJk1AShHujI+GEVues3T6NjrSHaJk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18677},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"754909c11c3c9648b888528090643634a021e7f2","scripts":{"lint":"bun x tsc --noEmit","test":"bun test","build":"bun build src/index.ts --target node --outdir dist --minify --sourcemap","clean":"rm -rf dist","types":"bun x tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false --outDir dist","release":"git push && npm publish","test:coverage":"bun test --coverage","prepublishOnly":"rm -rf dist && bun run build && bun run types"},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"repository":{"url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git","type":"git"},"_npmVersion":"11.5.1","description":"A Mongoose plugin to customize the toJSON output.","directories":{},"sideEffects":false,"_nodeVersion":"24.7.0","publishConfig":{"tag":"latest","access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"peerDependencies":{"mongoose":"^8.18.1"},"_npmOperationalInternal":{"tmp":"tmp/mongoose-to-json_1.2.2_1757755206775_0.6908645229260149","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@anhkhoakz/mongoose-to-json","description":"A Mongoose plugin to customize the toJSON output.","version":"1.2.3","repository":{"type":"git","url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git"},"author":{"name":"anhkhoakz","url":"https://www.anhkhoakz.dev/"},"license":"Apache-2.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org","tag":"latest"},"keywords":["mongoose","plugin","toJSON","json"],"main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"build":"bun build src/index.ts --target node --outdir dist --minify --sourcemap","types":"bun x tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false --outDir dist","prepublishOnly":"rm -rf dist && bun run build && bun run types","release":"git push && npm publish","test":"bun test","test:coverage":"bun test --coverage","lint":"bun x tsc --noEmit","clean":"rm -rf dist"},"peerDependencies":{"mongoose":"^8.18.1"},"engines":{"node":">=18.0.0"},"sideEffects":false,"type":"module","_id":"@anhkhoakz/mongoose-to-json@1.2.3","gitHead":"1c4dc3516bca74c538bce233006b7fa46813ee68","homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-5yQkfX+Db1xgghGJLL7o/rlKTwsXG3MmVJSrGEMxs7qomNSMhD9uLprxoRqlMz90GO7FbNHsaMCr4KDU1IMngw==","shasum":"a3fd3a6784dedc9c4816a82339d07427124514b5","tarball":"https://registry.npmjs.org/@anhkhoakz/mongoose-to-json/-/mongoose-to-json-1.2.3.tgz","fileCount":5,"unpackedSize":18682,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGaXSylokZKbMtcTRj9cLS6PBWPFVI/971uD+HTriSnaAiBThj6D1Rh+1dqNWtioJgC96qvQabhjFCCDqoimg6arTA=="}]},"_npmUser":{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"},"directories":{},"maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mongoose-to-json_1.2.3_1757755438582_0.7366682655045318"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-03T03:12:07.635Z","modified":"2025-09-13T09:23:58.929Z","1.0.0":"2025-09-03T03:12:07.975Z","1.0.1":"2025-09-03T07:26:39.272Z","1.0.2":"2025-09-03T07:37:31.943Z","1.1.0":"2025-09-03T07:50:03.230Z","1.2.0":"2025-09-04T03:58:15.031Z","1.2.1":"2025-09-12T06:36:59.832Z","1.2.2":"2025-09-13T09:20:06.967Z","1.2.3":"2025-09-13T09:23:58.754Z"},"author":{"name":"anhkhoakz","url":"https://www.anhkhoakz.dev/"},"license":"Apache-2.0","homepage":"https://git.sr.ht/~anhkhoakz/mongoose-to-json#readme","keywords":["mongoose","plugin","toJSON","json"],"repository":{"type":"git","url":"https://git.sr.ht/~anhkhoakz/mongoose-to-json.git"},"description":"A Mongoose plugin to customize the toJSON output.","maintainers":[{"name":"anhkhoakz","email":"outgrow_footwear345@slmail.me"}],"readme":"# @anhkhoakz/mongoose-to-json\n\nA Mongoose plugin to customize the toJSON output.\n\n## Installation\n\nYou can install this package using `bun`, `yarn`, or `npm`.\n\n```shell\n# bun\nbun add @anhkhoakz/mongoose-to-json\n\n# yarn\nyarn add @anhkhoakz/mongoose-to-json\n\n# npm\nnpm install @anhkhoakz/mongoose-to-json --save\n```\n\n## Usage\n\n<!-- Setup as a global plugin for all Mongoose schemas:\n\n```js\nimport mongoose from 'mongoose'\nimport { toJSON } from '@anhkhoakz/mongoose-to-json'\n\n// Global plugin\nmongoose.plugin(toJSON)\n```\n\nOr for a specific schema: -->\nSetup as a global plugin for specific Mongoose schemas:\n\n```js\nimport mongoose from 'mongoose'\nimport { toJSON } from '@anhkhoakz/mongoose-to-json'\nconst { Schema } = mongoose\n\n// Define schema\nconst MySchema = new Schema({\n  name: String,\n  email: String\n})\n\n// Apply plugin\nMySchema.plugin(toJSON)\n```\n\n## Default Transformations\n\nThis plugin will normalize JSON output for client-side applications from:\n\n```json\n{\n  \"_id\": \"400e8324a71d4410b9dc3980b5f8cdea\",\n  \"__v\": 2,\n  \"name\": \"Item A\"\n}\n```\n\nTo a cleaner:\n\n```json\n{\n  \"id\": \"400e8324a71d4410b9dc3980b5f8cdea\",\n  \"name\": \"Item A\"\n}\n```\n\nBy default, the plugin:\n\n- Removes `__v` (version field)\n- Converts `_id` to `id`\n- Removes private paths\n\n## Configuration Options\n\nYou can configure which transformations to apply by setting options:\n\n```js\nimport mongoose from 'mongoose'\nimport { toJSON } from '@anhkhoakz/mongoose-to-json'\nconst { Schema } = mongoose\n\nconst schema = new Schema({\n  email: { type: String },\n  password: { type: String, private: true },\n  name: String\n})\n\n// Disable specific transformations\nschema.plugin(toJSON, {\n  toJSON: {\n    removeVersion: false,      // Keep __v field\n    normalizeId: false,        // Keep _id field\n    removePrivatePaths: false  // Keep private paths\n  }\n})\n```\n\n## Private Paths\n\nThe plugin automatically removes fields marked as private:\n\n```js\nconst schema = new Schema({\n  email: { type: String },\n  password: { type: String, private: true },\n})\n\nschema.plugin(toJSON)\n\nconst User = mongoose.model('users', schema)\nconst user = new User({ email: 'test@test.com', password: 'secret' })\n\nconsole.log(user.toJSON())\n```\n\nThis will output:\n\n```json\n{\n  \"id\": \"400e8324a71d4410b9dc3980b5f8cdea\",\n  \"email\": \"test@test.com\"\n}\n```\n\n## Custom Transform Function\n\nYou can use the plugin with your own custom transform function:\n\n```js\nschema.plugin(toJSON, {\n  toJSON: {\n    transform: (doc, ret) => {\n      // Your custom transformations\n      ret.customField = 'custom value'\n      return ret\n    }\n  }\n})\n```\n\n## API Reference\n\n### `toJSON(schema: Schema, options?: ToJSONOptions)`\n\nApplies the toJSON plugin to a Mongoose schema.\n\n#### Options\n\n- `removeVersion?: boolean` - Remove `__v` field (default: `true`)\n- `normalizeId?: boolean` - Convert `_id` to `id` (default: `true`)\n- `removePrivatePaths?: boolean` - Remove private paths (default: `true`)\n- `transform?: TransformFunction` - Custom transform function\n\n## License\n\n[Apache License 2.0](LICENSE)\n\nCopyright (c) anhkhoakz\n","readmeFilename":"README.md"}