express-prettify

0.1.2 • Public • Published

express-prettify

NPM Version NPM Downloads Build Status Coverage Status Code Climate Known Vulnerabilities

express middleware to send pretty printed json

Install

$ npm install express-prettify

Examples

"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

Readme

Keywords

Package Sidebar

Install

npm i express-prettify

Weekly Downloads

7,527

Version

0.1.2

License

MIT

Unpacked Size

4.62 kB

Total Files

4

Last publish

Collaborators

  • stoshiya