0.7.2 • Published 10 months ago

axios-har-tracker v0.7.2

Weekly downloads
1
License
MIT
Repository
-
Last release
10 months ago

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");
0.7.2

10 months ago

0.7.1

10 months ago

0.7.0

10 months ago

0.6.1

1 year ago

0.5.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.0

3 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0-alpha

5 years ago

0.1.0-beta

5 years ago

0.1.0

5 years ago

1.0.0

5 years ago