{"id":14975643,"url":"https://github.com/compwright/mongoose-dompurify","last_synced_at":"2025-10-02T06:32:02.227Z","repository":{"id":57302032,"uuid":"99946426","full_name":"compwright/mongoose-dompurify","owner":"compwright","description":"DOMPurify plugin for Mongoose","archived":false,"fork":true,"pushed_at":"2020-12-17T16:47:35.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T20:56:21.391Z","etag":null,"topics":["mongoose","mongoose-plugin","nodejs","xss-filter"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mongoose-dompurify","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fauria/mongoose-sanitizer","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compwright.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"compwright"}},"created_at":"2017-08-10T17:01:37.000Z","updated_at":"2020-12-17T16:47:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/compwright/mongoose-dompurify","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fmongoose-dompurify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fmongoose-dompurify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fmongoose-dompurify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compwright%2Fmongoose-dompurify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compwright","download_url":"https://codeload.github.com/compwright/mongoose-dompurify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234951819,"owners_count":18912476,"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":["mongoose","mongoose-plugin","nodejs","xss-filter"],"created_at":"2024-09-24T13:52:19.639Z","updated_at":"2025-10-02T06:31:56.921Z","avatar_url":"https://github.com/compwright.png","language":"JavaScript","funding_links":["https://github.com/sponsors/compwright"],"categories":[],"sub_categories":[],"readme":"# mongoose-dompurify\n\n[![Build Status](https://travis-ci.org/compwright/mongoose-dompurify.svg?branch=master)](https://travis-ci.org/compwright/mongoose-dompurify)\n[![Dependency Status](https://img.shields.io/david/compwright/mongoose-dompurify.svg?style=flat-square)](https://david-dm.org/compwright/mongoose-dompurify)\n[![Download Status](https://img.shields.io/npm/dm/mongoose-dompurify.svg?style=flat-square)](https://www.npmjs.com/package/mongoose-dompurify)\n[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor\u0026message=❤\u0026logo=GitHub\u0026link=https://github.com/sponsors/compwright)](https://github.com/sponsors/compwright)\n\n[DOMPurify](https://github.com/cure53/DOMPurify) plugin for Mongoose schemas that sanitizes documents before saving.\n\n## Installation\n\n```bash\n$ npm install --save mongoose-dompurify\n```\n\n## Usage\n\n```javascript\nconst sanitizerPlugin = require('mongoose-dompurify');\n\nMyMongooseSchema.plugin(sanitizerPlugin, {\n  // Do not sanitize these fields (default: [])\n  skip: [],\n\n  // Encode HTML entities? (default: false)\n  encodeHtmlEntities: false,\n\n  // Configure DOMPurify, see https://github.com/cure53/DOMPurify for a list of options (default: undefined)\n  sanitizer: {\n    SAFE_FOR_JQUERY: true,\n    SAFE_FOR_TEMPLATES: true,\n    ALLOWED_TAGS: []\n  }\n});\n```\n\nWhen saving a document generated with `MyMongooseSchema`, mongoose-dompurify will automatically perform sanitization before saving to the database.\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2017 Jonathon Hill \u003cjhill9693@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fmongoose-dompurify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompwright%2Fmongoose-dompurify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompwright%2Fmongoose-dompurify/lists"}