# express-json

> A middleware for Express that sets Content-Type to text/plain if Accept header doesn't contain application/json.

Latest version **1.0.0** (published 2014-05-12) · 0 weekly downloads

## Install

```sh
npm install express-json
pnpm add express-json
yarn add express-json
bun add express-json
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-05-12 |
| First published | 2014-05-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jg8tf4 |
| Keywords | express, middleware, json |

## Links

- npm: https://www.npmjs.com/package/express-json
- npm.io page: https://npm.io/package/express-json

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-05-12

## README

# express-json

A middleware for [Express](https://github.com/visionmedia/express)
that sets `Content-Type` to `text/plain` if `Accept` header doesn't
contain `application/json`.

## Installation

```bash
$ npm install express-json
```

## Usage

```js
var express = require('express'),
    json = require('express-json');

var app = express()
  .use(json())
  .use(function (req, res) {
    res.json({
        helloWorld: 'Hello World!'
    });
  })
  .listen(3000);
```

---
_Source: https://npm.io/package/express-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
