
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
A very lightweight http promise wrapper based on typescript.
As a lot of other users I had to do http requests on our server, but had no library for that. So I tried several packages until I found out that node ships with the exact same functions I needed for sending my requests. This library is just a simple promise wrapper to the http module of node.
npm install gibma
Simply import the package and use the request
function.
import {request} from 'gibma'
async function doMyGetRequest() {
const response = await request('https://reqres.in/api/users', {method: 'GET'})
const raw = response.data // this returns a string
const json = response.json() // this returns the parsed json object
}
async function doMyPostRequest() {
const response = await request('https://reqres.in/api/users', {
method: 'POST', data: {name: 'gibma', job: 'best-job-ever'}
})
const raw = response.data // this returns a string
const json = response.json() // this returns the parsed json object
}
This returns a customized IncomingMessage
response which carries the raw data in data
attribute.
You can easily get the parsed json (if available) with the json
function of the response
.
FAQs
A very lightweight http promise wrapper based on typescript.
The npm package gibma receives a total of 5 weekly downloads. As such, gibma popularity was classified as not popular.
We found that gibma 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.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.