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

@esatterwhite/micromock

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esatterwhite/micromock

Minimal HTTP Request / Response object for node js

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

micromock-node

Minimal HTTP Request / Response object for node js

Initiall implemented for skyring and a replacement for hammock for use in ringpop while adding support for node >= 10

const {Request, Response} = require('micromock')

var req = new new Request({
        url: '/foo',
        headers: { host: 'localhost', bar: 'baz' },
        method: 'GET'
    }),
    res = new Response();

res.on('end', function(err, data) {
     console.log(data.statusCode);
     console.log(util.inspect(data.headers));
     console.log(data.body);
});

Keywords

http

FAQs

Package last updated on 05 May 2019

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