MCPcopy
hub / github.com/electerm/electerm / phin

Function phin

npm/utils.js:241–250  ·  view source on GitHub ↗

* Phin replacement - simple promisified HTTP client * @param {object} options - Request options * @param {string} options.url - URL to fetch * @param {number} options.timeout - Request timeout (default: 15000) * @returns {Promise<{body: Buffer, statusCode: number, headers: object}>}

(options)

Source from the content-addressed store, hash-verified

239 * @returns {Promise<{body: Buffer, statusCode: number, headers: object}>}
240 */
241async function phin (options) {
242 const { url, timeout = 15000 } = options
243 const body = await httpGet(url, timeout)
244
245 return {
246 body: Buffer.from(body),
247 statusCode: 200,
248 headers: {}
249 }
250}
251
252phin.promisified = phin
253

Callers 3

getVerFunction · 0.85
getReleaseInfoFunction · 0.85

Calls 1

httpGetFunction · 0.85

Tested by

no test coverage detected