New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bandwidth-usage-tracker

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bandwidth-usage-tracker

This package helps you to track the bandwidth usage of the AJAX requests processed by your application.

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Bandwidth Usage Tracker

This package helps you to track the bandwidth usage of the AJAX requests processed by your application.

It's a wrapper around axios which is a popular Promise based HTTP client for hadling AJAX request.

Installing

Using npm:

npm install bandwidth-usage-tracker
npm install axios

Example

import bandwidthMonitor from bandwidth-usage-tracker;
const axios = require('axios').default;


var bandwidthMonitorLog = [];
const updateBandwidthMonitorLog = function( log ) {
    bandwidthMonitorLog.push( log );
};

const form = document.getElementById("form");

form.addEventListener("submit", function (e) {
    e.preventDefault();

    let config = {
        url: '/',
        method: 'post',
        data: { title: 'Testing' },
        bandwidthMonitorOnFinish: updateBandwidthMonitorLog,
    };

    bandwidthMonitor( axios, config )
        .then(function( response ) {
            console.log( { response } );
        })
        .catch(function( error ) {
            console.log( { error } );
        })
        .finally(function() {
            console.log( 'bandwidthMonitorLog', { bandwidthMonitorLog } );
        });
});

Keywords

bandwidth-usage-tracker

FAQs

Package last updated on 31 Jul 2021

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