Small callback and Promise wrapper around node-libcurl for server-side transfers.
npm install request-libcurlRequires Node.js 22.15 or newer. Bun runtime is not supported because node-libcurl currently requires unsupported libuv APIs.
import { requestAsync } from 'request-libcurl';
const { statusCode, headers, body } = await requestAsync({
url: 'https://example.com/data.json',
retry: false
});import request from 'request-libcurl';
request({ url: 'https://example.com', retry: false }, (error, response) => {
if (error) throw error;
console.log(response.statusCode);
});const { default: request, requestAsync } = require('request-libcurl');TLS certificate verification remains disabled by default for compatibility. This permits man-in-the-middle attacks when the network or endpoint is untrusted. Enable verification for normal HTTPS traffic:
request.defaultOptions.rejectUnauthorized = true;
request.defaultOptions.rejectUnauthorizedProxy = true;BSD-3-Clause