# @types/body-parser-xml

> TypeScript definitions for body-parser-xml

Latest version **2.0.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/body-parser-xml
pnpm add @types/body-parser-xml
yarn add @types/body-parser-xml
bun add @types/body-parser-xml
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.5 |
| Published | 2023-11-07 |
| First published | 2018-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51468 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/body-parser-xml
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser-xml
- npm.io page: https://npm.io/package/@types/body-parser-xml

## Dependencies (5)

- [@types/node](https://npm.io/package/@types/node.md) *
- [@types/xml2js](https://npm.io/package/@types/xml2js.md) *
- [@types/connect](https://npm.io/package/@types/connect.md) *
- [@types/body-parser](https://npm.io/package/@types/body-parser.md) *
- [@types/express-serve-static-core](https://npm.io/package/@types/express-serve-static-core.md) *

## Recent versions

- 2.0.5 (latest) — 2023-11-07
- 2.0.2 (ts3.7) — 2021-11-16
- 2.0.1 (ts3.6) — 2021-07-07
- 1.1.0 (ts2.3) — 2018-04-26
- 2.0.4 — 2023-10-17
- 2.0.3 — 2023-09-15
- 2.0.0 — 2021-06-18

## README

# Installation
> `npm install --save @types/body-parser-xml`

# Summary
This package contains type definitions for body-parser-xml (https://github.com/fiznool/body-parser-xml).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser-xml.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser-xml/index.d.ts)
````ts
/// <reference types="node" />

// import bodyParser = require('body-parser');
import { BodyParser } from "body-parser";
import { NextHandleFunction } from "connect";
import { Request, Response } from "express-serve-static-core";
import { ParserOptions } from "xml2js";

/**
 * This library adds an xml method to the body-parser object.
 */
declare function bodyParserXml(bodyParser: BodyParser): void;

declare namespace bodyParserXml {
    interface Options {
        /**
         * Specify the default character set for the text content if the charset is not specified in the Content-Type header of the request.
         * @default 'utf-8'
         */
        defaultCharset?: BufferEncoding | undefined;
        /**
         * When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected.
         * @default true
         */
        inflate?: boolean | undefined;
        /**
         * Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the bytes library for parsing.
         * @default '100kb'
         */
        limit?: string | number | undefined;
        /**
         * The type option is used to determine what media type the middleware will parse.
         * @default ['_/xml', '+xml']
         */
        type?: string | string[] | ((req: Request) => boolean) | undefined;
        /**
         * The verify option, if supplied, is called as verify(req, res, buf, encoding),
         * where buf is a Buffer of the raw request body and encoding is the encoding of the request.
         * The parsing can be aborted by throwing an error.
         */
        verify?: ((req: Request, res: Response, buf: Buffer, encoding: BufferEncoding) => void) | undefined;
        /**
         * This option controls the behaviour of the XML parser
         */
        xmlParseOptions?: ParserOptions | undefined;
    }
}

export = bodyParserXml;

declare module "body-parser" {
    interface BodyParser {
        xml(options?: bodyParserXml.Options): NextHandleFunction;
    }
}

````

### Additional Details
 * Last updated: Mon, 06 Nov 2023 22:41:05 GMT
 * Dependencies: [@types/body-parser](https://npmjs.com/package/@types/body-parser), [@types/connect](https://npmjs.com/package/@types/connect), [@types/express-serve-static-core](https://npmjs.com/package/@types/express-serve-static-core), [@types/node](https://npmjs.com/package/@types/node), [@types/xml2js](https://npmjs.com/package/@types/xml2js)

# Credits
These definitions were written by [tbounsiar](https://github.com/tbounsiar), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

---
_Source: https://npm.io/package/@types/body-parser-xml · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
