Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@meeshkanml/express-middleware

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meeshkanml/express-middleware

Express middleware to create .jsonl files for consumption by Meeshkan.

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
4
Created
Source

CircleCI npm version

Meeshkan express middleware

Express server middleware to log requests and responses in the HTTP Types format.

Installation

Install via npm:

npm install @meeshkanml/express-middleware

Usage

Add this middleware before adding routes, otherwise it won't work.

const mw, { LocalFileSystemTransport } = require("@meeshkan/express-middleware");

// Add custom transports with signature
// `type HttpExchangeTransport = (httpExchange: HttpExchange) => Promise<void>;`
// Here `HttpExchange` is defined in `ts-http-types`
const customTransport = async httpExchange => {
  console.log("Got http exchange", httpExchange);
};

// Add middleware
app.use(
  middleware({
    transports: [
      LocalFileSystemTransport("http-exchanges.jsonl"),
      customTransport
    ],
  })
);
// add routes

Development

Install dependencies:

$ yarn

Run tests:

$ yarn test

Compile TypeScript:

$ yarn compile

Publish package:

$ yarn publish --access public

Push git tags:

$ TAG=v`cat package.json | grep version | awk 'BEGIN { FS = "\"" } { print $4 }'`
$ git tag -a $TAG -m $TAG
$ git push origin $TAG

Keywords

express

FAQs

Package last updated on 10 Mar 2020

Did you know?

Socket

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