Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@koibanx/http
Advanced tools
Koibanx's Axios based generic HTTP module
Add the dependency to your package.json file by running
npm install @koibanx/http
NOTE: you must have the npm token in your .npmrc file
Initialize the client by setting the optional default parameters:
import http from "@koibanx/http";
const baseURL = "anyurl.com/api"
const timeout = 5000
const baseHeaders = {
"Authorization": "JWT some-token",
"Content-Type": "application/json"
}
const logRequestInterceptor = (request) => console.log("Request:", request)
const logResponseInterceptor = (response) => console.log("Response:", response)
const requestInterceptors = [logRequestInterceptor]
const responseInterceptors = [logResponseInterceptor]
// initialize client
const client = http({ baseURL, timeout, baseHeaders, requestInterceptors, responseInterceptors })
const extraHeaders = { "Custom-Header": "SOME_VALUE" }
const foos = await httpGet({url: "/foo", headers: extraHeaders})
console.log("Received foos", foos)
const bar = {
bar: "bar"
}
const createdBar = await httpPost({url: "/bar", headers: extraHeaders, body: bar})
console.log("Received response", createdBar)
FAQs
Koibanx's Axios based generic HTTP module
The npm package @koibanx/http receives a total of 1,393 weekly downloads. As such, @koibanx/http popularity was classified as popular.
We found that @koibanx/http demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.