UNPKG

deprecopilot

Version:

Automated dependency management with AI-powered codemods

21 lines (20 loc) 574 B
import { request } from 'http'; export async function sendTelemetry(data) { try { const payload = JSON.stringify(data); const req = request({ hostname: 'telemetry.example.com', // dummy endpoint port: 80, path: '/collect', method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload) } }); req.on('error', () => { }); req.write(payload); req.end(); } catch { } }