Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/piecioshka/xhr-sniffer

:hammer: Sniff HTTP requests making by XHR in the browser or HTTP module in Node.js
https://github.com/piecioshka/xhr-sniffer

debugging http sniffer xhr

Last synced: 22 days ago
JSON representation

:hammer: Sniff HTTP requests making by XHR in the browser or HTTP module in Node.js

Awesome Lists containing this project

README

        

# xhr-sniffer

[![node version](https://img.shields.io/node/v/xhr-sniffer.svg)](https://www.npmjs.com/package/xhr-sniffer)
[![npm version](https://badge.fury.io/js/xhr-sniffer.svg)](https://badge.fury.io/js/xhr-sniffer)
[![downloads count](https://img.shields.io/npm/dt/xhr-sniffer.svg)](https://www.npmjs.com/package/xhr-sniffer)
[![size](https://packagephobia.com/badge?p=xhr-sniffer)](https://packagephobia.com/result?p=xhr-sniffer)
[![license](https://img.shields.io/npm/l/xhr-sniffer.svg)](https://piecioshka.mit-license.org)
[![github-ci](https://github.com/piecioshka/xhr-sniffer/actions/workflows/testing.yml/badge.svg)](https://github.com/piecioshka/xhr-sniffer/actions/workflows/testing.yml)

🔨 Sniff HTTP requests making by XHR in the browser or HTTP module in Node.js

## Preview 🎉

## Features

* ✅ Display logs of `XMLHttpRequests` in DevTools Console
* ✅ Display logs of `http` module in `Node.js`
* ⛔️ Sniffing `Fetch API`

## Install

```bash
npm install xhr-sniffer
```

## Usage

### Sniff requests in `Node.js`

```javascript
const xhrSniffer = require('xhr-sniffer');

xhrSniffer.install();

// do XHR requests

xhrSniffer.uninstall();
```

### Sniff requests in `browser`

Attach files in `` tag:

```html

```

Next, make some XMLHttpRequests requests.

## Unit tests

```bash
npm test
```

## Code coverage

```bash
npm run coverage
```

## License

[The MIT License](https://piecioshka.mit-license.org) @ 2018