{"id":28137096,"url":"https://github.com/navneetlal/xml-middleware-expressjs","last_synced_at":"2025-05-14T16:22:26.994Z","repository":{"id":57129488,"uuid":"357179846","full_name":"navneetlal/xml-middleware-expressjs","owner":"navneetlal","description":"XML middleware to provide support for xml with easy setup","archived":false,"fork":false,"pushed_at":"2023-03-06T00:14:18.000Z","size":139,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T01:08:40.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/navneetlal.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-12T12:11:03.000Z","updated_at":"2021-04-16T10:21:22.000Z","dependencies_parsed_at":"2025-03-08T13:01:00.697Z","dependency_job_id":null,"html_url":"https://github.com/navneetlal/xml-middleware-expressjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navneetlal%2Fxml-middleware-expressjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navneetlal%2Fxml-middleware-expressjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navneetlal%2Fxml-middleware-expressjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navneetlal%2Fxml-middleware-expressjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navneetlal","download_url":"https://codeload.github.com/navneetlal/xml-middleware-expressjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254180010,"owners_count":22027914,"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":[],"created_at":"2025-05-14T16:21:06.666Z","updated_at":"2025-05-14T16:22:26.978Z","avatar_url":"https://github.com/navneetlal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XML Middleware\n\nA simple middleware for expressjs which allow an easy setup for xml support. Apart from that it also provides a standard response object for consistency.\n\n## Installing\n\nUsing npm:\n\n```bash\nnpm install @navneetlal/xml-middleware --save\n```\n\nUsing yarn:\n\n```bash\nyarn add @navneetlal/xml-middleware\n```\n\n## Usage\n\n`body-parser` or other (which can parse request body to text) is required for this middleware to work.\n\n### CommonJS usage\n\n```js\nconst xmlMiddleware = require('@navneetlal/xml-middleware');\nconst { text as textParserMiddleware } = require('body-parser');\n\napp.use(textParserMiddleware({ type: ['xml', '+xml', 'text/xml'] }));\napp.use(xmlMiddleware());\n```\n\nNow in order to send response, use `res.sendResponse()` instead of standard method provided by express.\n\nYou can also make use of `ServerResponse` class to construct a response object\n\n```js\nconst responseObject = new ServerResponse(true, 'Success')\nresponseObject.results = { some: 'json' }\n\nres.sendResponse(responseObject)\nres.sendResponse(400, new ServerResponse(false, 'Oops! Somethings doesn\\'t look right'))\n```\n\n### Typescript usage\n\nThis package is built on typescript and provides full support for the same.\n\n## Issues\n\nIn case of any problem in the package open an issue here at [https://github.com/navneetlal/xml-middleware-expressjs/issues](https://github.com/navneetlal/xml-middleware-expressjs/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavneetlal%2Fxml-middleware-expressjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavneetlal%2Fxml-middleware-expressjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavneetlal%2Fxml-middleware-expressjs/lists"}