A lightweight TypeScript utility to convert Axios requests and errors into cURL commands for debugging and logging. Version 2.0.7 is released under MIT license. It supports all common HTTP methods, query parameters, headers, request bodies (JSON, strings, buffers), and anonymization of sensitive fields (including nested fields via dot notation). Unlike alternatives that require manual formatting, it integrates directly with Axios config and error objects. The package is ESM-only and ships TypeScript types. Release cadence is stable, with minor updates.
npm install nestjs-convert-to-curlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates catching an Axios error and converting it to a cURL command for debugging.
Use import statements or dynamic import() in CommonJS projects.
Ensure you pass an Axios error (from catch) or an Axios config object (with method, url, etc.).
Manually sanitize headers and URL if needed, or open a feature request.
Change to import { AxiosConverter } from 'nestjs-convert-to-curl'.Ensure the argument is an Axios error (e.g., catch (error) {...}) and error.response exists.Provide a config object with at least 'method' and 'url' properties.
Use import or use dynamic import() inside an async function.