Socket
Socket
Sign inDemoInstall

jsout-express

Package Overview
Dependencies
67
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jsout-express

Simple express request logger middleware for jsout.


Version published
Maintainers
1
Created

Readme

Source

jsout-express

build status semantic-release Conventional Commits SemVer

Simple express request logger middleware for jsout.

Log example

{
  "level": 30,
  "message": "req",
  "data": {
    "method": "GET",
    "url": "/",
    "hostname": "localhost",
    "ip": "::ffff:127.0.0.1",
    "statusCode": 200,
    "statusMessage": "OK",
    "durationMs": 3.2342
  },
  "context": {
    "date": "2022-12-20T04:52:03.622Z",
    "pid": 10728,
    "ppid": 10725,
    "nodeVersion": "v16.13.0"
  }
}

Installation

npm i jsout jsout-express

Usage

Include it like you would any other middleware, but it should be first (or towards the top) to be accurate. At the very least, it must be before any other handler that might send a response.

import {express} from 'express';
import {logger} from 'jsout';
import {logRequest} from 'jsout-express';

const app = express();

// should be first, before other middlewares
app.use(logRequest);

// ... other things ...

app.listen();

Contribution

Please contribute to this project! Issue a PR against master and request review.

  • Please test your work thoroughly.
  • Make sure all tests pass with appropriate coverage.

How to build locally

npm i

Running tests

npm test

Keywords

FAQs

Last updated on 20 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc