MCPcopy Create free account
hub / github.com/mempool/mempool / httpsRequest

Function httpsRequest

frontend/sync-assets.js:61–71  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

59
60// Utility: Make HTTPS request
61const httpsRequest = (options) => {
62 return new Promise((resolve, reject) => {
63 https.get(options, (response) => {
64 const chunks = [];
65
66 response.on('data', (chunk) => chunks.push(chunk));
67 response.on('end', () => resolve(Buffer.concat(chunks)));
68 response.on('error', reject);
69 }).on('error', reject);
70 });
71};
72
73// Utility: Download file
74const downloadFile = (filePath, url) => {

Callers 1

fetchGitHubContentsFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected