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.
Basically This package is working as Axios's interceptors.
$ npm install axios-logger --save-dev
You can use various loggers through the axios
's interceptor API.
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 own interceptor, you can compose(mixin) with requestLogger
.
instance.interceptors.request.use((config) => {
// write down your request intercept.
return AxiosLogger.requestLogger(config);
});
import axios from 'axios';
import AxiosLogger from 'axios-logger';
const instance = axios.create();
instance.interceptors.request.use(AxiosLogger.responseLogger);
Also if you want to use your own interceptor, you can compose(mixin) with responseLogger
.
instance.interceptors.response.use((response) => {
// write down your response intercept.
return AxiosLogger.responseLogger(response);
});
You can inject errorLogger
right after requestLogger
or responseLogger
.
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);
Also if you want to use your own interceptor, you can compose(mixin) with errorLogger
.
instance.interceptors.response.use(AxiosLogger.requestLogger, (err) =>{
// write down your error intercept.
return AxiosLogger.errorLogger(err);
});
I always welcome Feedback and Pull 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.