Skip to content

the-wunmi/vigilante

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vigilante

Vigilante is a zero dependency module that monkey patches and intercepts all network requests within a node application using the NodeJS http and https module.

/**
 * Import the vigilante module. It emits success and error events.
 **/
require('./')
  .on('success', (request, response) => {
    console.log(request, response)
  })
  .on('error', (request, response) => {
    console.log(request, response)
  })

Sample Request

{
  "host": "github.com",
  "port": null,
  "hash": null,
  "search": null,
  "query": null,
  "pathname": "/the-wunmi",
  "path": "/the-wunmi",
  "href": "https://github.com/the-wunmi",
  "url": "",
  "method": "GET",
  "headers": "",
  "body": ""
}

Sample Response

{
  "statusCode": 200,
  "headers": {},
  "trailers": {},
  "httpVersion": "1.1",
  "url": "",
  "body": "..."
}

About

Vigilante is a zero dependency module that monkey patches and intercepts all network requests within a node application using the NodeJS http and https module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors