Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-har-tracker

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-har-tracker

![npm](https://img.shields.io/npm/v/axios-har-tracker?color=9cf&style=plastic)

  • 0.7.1
  • npm
  • Socket score

Version published
Weekly downloads
185
decreased by-34.63%
Maintainers
0
Weekly downloads
 
Created
Source

npm

This library was designed for gathering HAR files from requests sent using axios

Credits

Inspiration and some pieces of the code comes from maciejmaciejewski/request-har

Usage

In order to use this package install it

npm install axios-har-tracker

and import it by

import { AxiosHarTracker } from "axios-har-tracker";

and axios package

import axios from "axios";

which will be passed into AxiosHarTracker constructor:

const axiosTracker = new AxiosHarTracker(axios);

In order to perform an actual request use the axios.get/post/delete... call, examples:

await axios.get("http://httpstat.us/200");

or with catching an error

try {
  await axios.get("http://httpstat.us/404");
} catch (error) {
  console.log("An error appears after call to https://httpstat.us/404:", error);
}

Every single request is pushed into the object and user can get it by using

const generatedObject = axiosTracker.getGeneratedHar();

Object can be saved into a file in any time using e.g.

writeFileSync("example.har", JSON.stringify(generatedObject), "utf-8");

Keywords

FAQs

Package last updated on 23 Sep 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc