
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@everymundo/promise-data-to
Advanced tools
This is a helper to perform POST requests using promises and no external dependencies
This is a helper to perform POST requests using promises.
npm install @everymundo/promise-data-to
const httpClient = require('@everymundo/promise-data-to')
const headers = { 'content-type': 'application/json' }
const endpoint = new httpClient.PostEndpoint('http://your-host.com/path', headers)
const data = { myData:'Something' }
const res = await httpClient.promiseDataTo(endpoint, data)
const httpClient = require('@everymundo/promise-data-to')
const headers = { 'authorization': 'your token' }
const endpoint = new httpClient.GetEndpoint('http://your-host.com/path', headers)
const res = await httpClient.promiseGet(endpoint)
const httpClient = require('@everymundo/promise-data-to')
const headers = { 'authorization': 'your token' }
const res = await httpClient.fetch('http://your-host.com/path', { headers, body: data })
const { fetch } = require('@everymundo/promise-data-to')
const headers = { 'authorization': 'your token' }
const res = await fetch('http://your-host.com/path', { headers })
{
statusCode, // the response statusCode
code, // alias for statusCode [for backaward compatibility]
start, // Date Object captured right before starting the request
end: Date.now(), // Int Timestamp from when the request has finished
attempt, // the number of attempts of the retries
endpoint, // the endpoint object either passed or generated from a string
resTxt, // alias for responseText [for backaward compatibility]
responseText, // the response buffer.toString()
buffer, // raw response buffer
dataType, // the name of the constructor of the posted data [Array, Object, String, Buffer]
dataLen, // when posting arrays it shows the number of array items posted
compress, // the type of compression for the POST request, if any. Valid values are gzip and deflate
requestHeaders, // the headers used on the request
responseHeaders // the headers received from the remote server
}
FAQs
This is a helper to perform POST requests using promises and no external dependencies
The npm package @everymundo/promise-data-to receives a total of 1 weekly downloads. As such, @everymundo/promise-data-to popularity was classified as not popular.
We found that @everymundo/promise-data-to demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 34 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.