Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
axios-core-api
Advanced tools
This package can be used to create a core api class to route requests between a client and an api.
It is written in TypeScript, and typings are included directly in the package.
yarn add axios-core-api
or npm install axios-core-api
You can read an in depth article on why and how to uses this package on medium.
import ApiCore from "axios-core-api";
const apiConfig = {
headers: {
Accept: "application/json",
Authorization: `Bearer 123abc`,
"Content-Type": "application/json",
},
timeout: 15000,
};
export default class CrudApi {
constructor() {
this._apiCore = new ApiCore(apiConfig);
this._basePath = "https://www.crud.org/api";
}
}
import { AxiosRequestConfig } from "axios";
import ApiCore from "axios-core-api";
const apiConfig: AxiosRequestConfig = {
headers: {
Accept: "application/json",
Authorization: `Bearer 123abc`,
"Content-Type": "application/json",
},
timeout: 15000,
};
export default class CrudApi {
_apiCore: ApiCore;
_basePath: string;
constructor() {
this._apiCore = new ApiCore(apiConfig);
this._basePath = "https://www.crud.org/api";
}
}
getAll() {
return this._apiCore.get(`${this._basePath}`);
}
getOne(id) {
return this._apiCore.get(`${this._basePath}/${id}`);
}
create(newExample) {
return this._apiCore.post(`${this._basePath}`, newExample);
}
createForm(newExample) {
return this._apiCore.postFormData(`${this._basePath}`, newExample);
}
updatePut(id, nextExample) {
return this._apiCore.put(`${this._basePath}/${id}`, nextExample);
}
updatePatch(id, nextExample) {
return this._apiCore.patch(`${this._basePath}/${id}`, nextExample);
}
destroy(id) {
return this._apiCore.delete(`${this._basePath}/$id`);
}
refreshApiInstance(newAccessToken) {
const newConfig = apiConfig;
newConfig.headers.Authorization = `Bearer ${newAccessToken}`;
this._apiCore.refreshApiInstance(newConfig);
}
FAQs
A core api instance with business logic for all CRUD methods.
The npm package axios-core-api receives a total of 3 weekly downloads. As such, axios-core-api popularity was classified as not popular.
We found that axios-core-api demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.