https://github.com/stoshiya/express-prettify
express middleware to send pretty printed json
https://github.com/stoshiya/express-prettify
express-middleware json nodejs pretty-print
Last synced: 5 months ago
JSON representation
express middleware to send pretty printed json
- Host: GitHub
- URL: https://github.com/stoshiya/express-prettify
- Owner: stoshiya
- License: mit
- Created: 2016-02-24T01:12:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T10:14:49.000Z (about 4 years ago)
- Last Synced: 2024-04-25T07:41:43.310Z (about 2 years ago)
- Topics: express-middleware, json, nodejs, pretty-print
- Language: JavaScript
- Size: 44.9 KB
- Stars: 18
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# express-prettify
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[](https://travis-ci.org/stoshiya/express-prettify)
[](https://coveralls.io/github/stoshiya/express-prettify?branch=master)
[](https://codeclimate.com/github/stoshiya/express-prettify)
[](https://snyk.io/test/github/stoshiya/express-prettify)
express middleware to send pretty printed json
## Install
$ npm install express-prettify
## Examples
```js
"use strict";
var app = require('express')();
var pretty = require('express-prettify');
app.use(pretty({ query: 'pretty' }));
app.get('/', function(req, res) {
res.json({ hello: 'world', body: 'This is pretty printed json' });
});
app.listen(3000);
```
$ node app.js &
$ curl http://localhost:3000?pretty
{
"hello": "world",
"body": "This is pretty printed json"
}
$ curl http://localhost:3000
{ "hello": "world", "body": "This is pretty printed json" }
## License
[MIT](http://stoshiya.mit-license.org/2016)
[npm-image]: https://img.shields.io/npm/v/express-prettify.svg?style=flat
[npm-url]: https://npmjs.org/package/express-prettify
[downloads-image]: https://img.shields.io/npm/dm/express-prettify.svg?style=flat
[downloads-url]: https://npmjs.org/package/express-prettify