UNPKG

xhr-sniffer

Version:

šŸ”Ø Sniff HTTP requests making by XHR in the browser or HTTP module in Node.js

56 lines (35 loc) • 1.53 kB
# 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 šŸŽ‰ <https://piecioshka.github.io/xhr-sniffer/demo/browser/> ## Features - āœ… Display logs of `XMLHttpRequests` in DevTools Console - āœ… Display logs of `http` module in `Node.js` - ā›”ļø Sniffing `Fetch API` ## Usage Installation: ```bash npm install xhr-sniffer ``` ### 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 `<head>` tag: ```html <script src="xhr-sniffer/src/common.js"></script> <script src="xhr-sniffer/src/browser.js"></script> ``` Next, make some XMLHttpRequests requests. ## License [The MIT License](https://piecioshka.mit-license.org) @ 2018