Skip to content

curl

import { curl } from 'sysopkit/op/curl';

Makes HTTP requests via curl:

const result = await curl('https://api.example.com/data');
// { stdout, stderr, exitCode }

Supports all standard curl flags:

const result = await curl([
'-X',
'POST',
'-H',
'Content-Type: application/json',
'-d',
JSON.stringify({ key: 'value' }),
'https://api.example.com/data',
]);