Registry / testing / jin-axios-curlize

jin-axios-curlize

JSON →
library1.3.0jsnpmunverified

jin-axios-curlize is a utility library for converting AxiosRequestConfig objects into curl commands, useful for debugging and reproducing HTTP requests. Version 1.3.0 (stable) targets Node >=18 and ships TypeScript types. It works without interceptors, supports customizable replacers for query strings, headers, and bodies, and can prettify output. Unlike alternatives that require executing the request, this library creates curl commands directly from the config.

npm install jin-axios-curlize
INSTALL
IMPORT
SIG · JIN-AXIOS-CURLIZE
J
jin-axios-curlize
testingjavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createFromAxios
import { createFromAxios } from 'jin-axios-curlize'
import createFromAxios from 'jin-axios-curlize'
Named export; default export does not exist. Must use destructuring.
createV3
import { createV3 } from 'jin-curlize'
import { createV3 } from 'jin-axios-curlize'
createV3 is from the separate 'jin-curlize' package, not jin-axios-curlize. Ensure correct package.
encodeQuerystring
import { encodeQuerystring } from 'jin-curlize'
import { encodeQuerystring } from 'jin-axios-curlize'
encodeQuerystring is from 'jin-curlize', not jin-axios-curlize.
type AxiosRequestConfig
import { AxiosRequestConfig } from 'axios'
import { AxiosRequestConfig } from 'jin-axios-curlize'
AxiosRequestConfig is a type from axios, not from this library.

Creates a curl command from an AxiosRequestConfig object after making a request.

import axios, { AxiosRequestConfig } from 'axios'; import { createFromAxios } from 'jin-axios-curlize'; const req: AxiosRequestConfig = { url: 'http://localhost:3000/v1/superhero/i-am-unique-id', method: 'put', data: { name: 'ironman' }, headers: { 'Content-Type': 'application/json' } }; const reply = await axios.request(req); console.log('curl command:', createFromAxios(req)); // curl -X PUT 'http://localhost:3000/v1/superhero/i-am-unique-id' -H 'Content-Type: application/json' -d $'{"name":"ironman"}'
Debug
Known issues
gotchacreateV3 and encodeQuerystring are from a separate package 'jin-curlize', not 'jin-axios-curlize'.
fix
Import createV3 and encodeQuerystring from 'jin-curlize' package.
affects: *
gotchaThe library does not execute the request; it only converts AxiosRequestConfig to a curl string. Ensure the config object is fully defined.
fix
Provide complete AxiosRequestConfig with url, method, headers, data, etc.
affects: *
deprecatedOptions like prettify and replacer may change; refer to documentation for exact usage.
fix
Use current options as described in README; check for updates.
affects: >=1.0.0
gotchaReplacer callbacks receive query string, body, or header as a string; must return a string.
fix
Ensure replacer functions return the modified string.
affects: *
Errors
Common errors & fixes
Module '"jin-axios-curlize"' has no exported member 'createV3'.
createV3 is exported from 'jin-curlize', not 'jin-axios-curlize'.
fix
Install 'jin-curlize' and import createV3 from 'jin-curlize'.
Cannot find module 'jin-axios-curlize' or its corresponding type declarations.
Package not installed or TypeScript module resolution issues.
fix
Run 'npm install jin-axios-curlize' and ensure tsconfig.json has 'moduleResolution': 'node'.
TypeError: createFromAxios is not a function
Importing as default export instead of named export.
fix
Use named import: import { createFromAxios } from 'jin-axios-curlize'.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies
axiosrequiredpeer dependency for the AxiosRequestConfig type and request execution
Agent activity
11 hits · last 30 days
node
10
Resources
jin-axios-curlize — npm install jin-axios-curlize · libregistry