Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
axios-logger
Advanced tools
Beautify Axios Logging Messages.
When you send a request in nodejs, you need to show the log to the console. This library display the necessary information while communicating with the server.
$ npm install axios-logger --save-dev
You can use logger with axios
interceptor.
import axios from 'axios';
import AxiosLogger from 'axios-logger';
const instance = axios.create();
instance.interceptors.request.use(AxiosLogger.requestLogger);
If you want to use your custom interceptor, you can mixin with logger like this.
instance.interceptors.request.use((config) => {
// write down your request intercept.
AxiosLogger.requestLogger(config);
});
import axios from 'axios';
import AxiosLogger from 'axios-logger';
const instance = axios.create();
instance.interceptors.request.use(AxiosLogger.responseLogger);
If you want to use your custom interceptor, you can mixin with logger like this.
instance.interceptors.response.use((response) => {
// write down your response intercept.
AxiosLogger.responseLogger(response);
});
You can errorLogger that pass second argument.
import axios from 'axios';
import AxiosLogger from 'axios-logger';
const instance = axios.create();
instance.interceptors.request.use(AxiosLogger.requestLogger, AxiosLogger.errorLogger);
instance.interceptors.response.use(AxiosLogger.responseLogger, AxiosLogger.errorLogger);
If you want to use your custom interceptor, you can mixin with logger like this.
instance.interceptors.response.use(AxiosLogger.requestLogger, (err) =>{
// write down your error intercept.
AxiosLogger.errorLogger(err);
});
I always welcome Feedback and Pall Request :)
FAQs
Beautify Axios Logging Messages
The npm package axios-logger receives a total of 57,326 weekly downloads. As such, axios-logger popularity was classified as popular.
We found that axios-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.