JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 231
  • Score
    100M100P100Q92374F
  • License MIT

Log http requests as ndjson

Package Exports

  • http-ndjson

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-ndjson) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

http-ndjson

NPM version build status Test coverage Downloads js-standard-style

Log http requests as ndjson.

Installation

$ npm install http-ndjson

Usage

const httpNdjson = require('http-ndjson')
const http = require('http')

http.createServer((req, res) => {
  httpNdjson(req, res).pipe(process.stdout)
  res.end()
}).listen()
{ name: 'http', method: 'GET', message: 'request', url: '/' }
{ name: 'http', method: 'GET', message: 'response', url: '/', statusCode: 200, elapsed: '5ms' }

API

writeStream = httpNdjson(req, res)

Create an http logger. Returns a write stream.

See Also

License

MIT