{"id":14975570,"url":"https://github.com/richard1320/mongoose-docs","last_synced_at":"2025-10-27T14:30:28.625Z","repository":{"id":57302028,"uuid":"376388127","full_name":"Richard1320/mongoose-docs","owner":"Richard1320","description":"Automatically create documentation for Mongoose schemas.","archived":false,"fork":false,"pushed_at":"2021-10-24T23:50:36.000Z","size":173,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T08:03:58.532Z","etag":null,"topics":["database","db","developer-tools","docs","document","documentation","model","mongodb","mongoose","mongoose-schema","mongoosejs","nosql","schema"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Richard1320.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-12T21:39:37.000Z","updated_at":"2023-08-17T17:35:56.000Z","dependencies_parsed_at":"2022-09-07T00:11:46.259Z","dependency_job_id":null,"html_url":"https://github.com/Richard1320/mongoose-docs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard1320%2Fmongoose-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard1320%2Fmongoose-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard1320%2Fmongoose-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richard1320%2Fmongoose-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Richard1320","download_url":"https://codeload.github.com/Richard1320/mongoose-docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238508457,"owners_count":19484134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","db","developer-tools","docs","document","documentation","model","mongodb","mongoose","mongoose-schema","mongoosejs","nosql","schema"],"created_at":"2024-09-24T13:52:13.570Z","updated_at":"2025-10-27T14:30:28.271Z","avatar_url":"https://github.com/Richard1320.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongoose Docs\n\nDocumentation for your project is very important but also very time-consuming. Programmers often need to leave\ndocumentation in the actual code for other developers and then write it again on the frontend for users who don't work\nwith the code.\n\nMongoose-docs allows you to comment your Mongoose schemas in the codebase and output it in a JSON format that can be\nrendered on the frontend, so you won't need to copy-paste-copy-paste from your code to a Google Doc.\n\n![Generated Documentation](./screenshot-html.jpg)\n\n## Mongoose Compatability\n\nMongoose Docs works with Mongoose 5.x and 6.x. However, you need to ensure you are using the correct combination of\nversions.\n\n| Mongoose Version | Mongoose-Docs Version |\n| --- | --- |\n| v5.x | v1.x |\n| v6.x | v2.x |\n\n## Installation\n\n`npm install mongoose-docs --save`\n\n## Usage\n\n1. Create your schemas and models. Fields can have a new `comment` property in the schema type which will be outputted\n   in the JSON.\n2. Execute the `mongooseDocsJSON` function and pass in `mongoose`. It will return the analyzed structure in a readable\n   JSON format.\n3. Optional: execute the `mongooseDocsOutputHTML` function and pass in the result from `mongooseDocsJSON` and the system\n   directory for the documentation HTML files.\n\n## Example\n\n```javascript\nimport {mongooseDocsJSON, mongooseDocsOutputHTML} from \"mongoose-docs\";\nimport mongoose, {Schema} from \"mongoose\";\n\n// Your schemas and models\nconst schemaOptions = {\n    timestamps: true,\n    comment: \"This collection contains all the users.\",\n};\nconst userSchema = new Schema({\n    email: {\n        type: String,\n        comment: \"This is the user email\", // New comment property on schema type\n        required: true,\n    },\n    password: {\n        type: String,\n        comment: \"This is the hashed password\", // New comment property on schema type\n        required: true,\n    },\n}, schemaOptions);\nmongoose.model('User', userSchema);\n\n// Pass in the Mongoose instance with the models implemented.\nconst schemaJSON = mongooseDocsJSON(mongoose);\n\n// Optional: Output documentation into HTML files\nmongooseDocsOutputHTML(schemaJSON, __dirname + \"/docs\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichard1320%2Fmongoose-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichard1320%2Fmongoose-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichard1320%2Fmongoose-docs/lists"}