{"_id":"@abhishekrajeshirke/axios-curlirize","_rev":"1-f9f58d911e9f80bbb9405fe45b57471f","name":"@abhishekrajeshirke/axios-curlirize","dist-tags":{"latest":"1.3.4"},"versions":{"1.3.4":{"name":"@abhishekrajeshirke/axios-curlirize","version":"1.3.4","description":"Axios third-party module to print all axios requests as curl commands in the console.","main":"index.js","scripts":{"test":"babel ./src --experimental --source-maps-inline -d ./dist && export NODE_ENV=test || SET \"NODE_ENV=test\" && mocha --exit dist/test/*.test.js","preinstall":"npm install","postinstall":"if [ -e ./node_modules/.bin/babel ]; then ./node_modules/.bin/babel ./src --experimental --source-maps-inline -d ./dist; fi"},"repository":{"type":"git","url":"git+https://github.com/delirius325/axios-curlirize.git"},"keywords":["axios","curl","debug"],"author":{"name":"delirius325"},"contributors":[{"name":"Justin \"jayceekay\"","url":"https://github.com/jayceekay"},{"name":"Peter \"binggg\" Zhao","url":"https://github.com/binggg"}],"license":"MIT","bugs":{"url":"https://github.com/delirius325/axios-curlirize/issues"},"homepage":"https://github.com/delirius325/axios-curlirize#readme","dependencies":{},"devDependencies":{"axios":">=0.19.0","babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.6.1","expect":"^23.1.0","express":"^4.16.3","mocha":"^5.2.0"},"gitHead":"0e09bcbd045033b4e0ba0c4ed25cb0f4574f5d96","_id":"@abhishekrajeshirke/axios-curlirize@1.3.4","_npmVersion":"6.4.1","_nodeVersion":"8.11.4","_npmUser":{"name":"colidarity","email":"arajeshirke79@gmail.com"},"dist":{"integrity":"sha512-SxtqqcSs9ifsAjqT3U5vA2YE+L3sgoU+Oph+u2TW2dSrtgpDLkUfoH0PdI+4bxZTAVz/9/wX/pV1H8Nw5eqcCQ==","shasum":"4f45a62123687bff256103d08f93baefbbe98930","tarball":"https://registry.npmjs.org/@abhishekrajeshirke/axios-curlirize/-/axios-curlirize-1.3.4.tgz","fileCount":11,"unpackedSize":16058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpv3BCRA9TVsSAnZWagAA7x0P/jTY84qB7gDCICA2OXZE\nctxvovRuqclKEegkHyamrN9u30hOXOGM60vRwzjkwl05zrEYShk503ayZMvE\n6xTTiurn/5vEsbFs57Qj5HM1fHbBY1eM/bnJpyrt7dRRPYYEqMacaEZD2A/f\n4H3FcOracee3ZYeeWIotnG63KOtmlZMp5TuxuUbb9DYw+dA5nk0SvUQX5m6t\nx9rrbpuw+fF58ajhxwr66czzsxuGgGKh+9GuyRnPw+zCxkrESsJigMSt+wxo\nchJb91X8HD6BVMYspts3X6yeJzxmWSwCmTa5TJWQQZyhD3YDORLYRNBe7Njg\nYsImz2Dp74primWG8oL2q9G/GMnlLzwLAtj3a/JyuXixQvI2qi/g0YMrIkRp\nVrmTaZVf3td6tXAd6vMCMYbEMXRRamO0bJrEuIm6xguZ1fDRz5TdrLY7Fdyv\nZU7wCR38pCREclFyPCr5kinG1JSRgpZtiFn0gCFCdvDWaDjnJ3XNt3lNwtyu\nQ5qmADTkVz/yuFgubBqyaghUbPxBBzfUFk8CZaZTcQbnu/AkOHeEUVL1Qm1V\nD2eX5FTvXoAuGxSAl862JKuG/+QM0pKYFLNoApD2YCJrx33Gg0OjtsvJurJf\nC6czelXhO6ZGmYiOBI7balrjUE0AB5zA9P8Rtq+l8EjuS8YyJmPm/xIHvfdE\nicJA\r\n=uviG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICniVSNYGhVJ/i6s1Zb/7Q/yyFP2lv2i7SOebNRqkdtmAiBLATlSmig/oE+Go47WLfG4IpV8ofu0xdHzD5zR+8imgA=="}]},"maintainers":[{"name":"colidarity","email":"arajeshirke79@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/axios-curlirize_1.3.4_1571225025116_0.37568761473718393"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-16T11:23:44.858Z","1.3.4":"2019-10-16T11:23:45.239Z","modified":"2022-04-04T10:59:25.057Z"},"maintainers":[{"name":"colidarity","email":"arajeshirke79@gmail.com"}],"description":"Axios third-party module to print all axios requests as curl commands in the console.","homepage":"https://github.com/delirius325/axios-curlirize#readme","keywords":["axios","curl","debug"],"repository":{"type":"git","url":"git+https://github.com/delirius325/axios-curlirize.git"},"contributors":[{"name":"Justin \"jayceekay\"","url":"https://github.com/jayceekay"},{"name":"Peter \"binggg\" Zhao","url":"https://github.com/binggg"}],"author":{"name":"delirius325"},"bugs":{"url":"https://github.com/delirius325/axios-curlirize/issues"},"license":"MIT","readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7d519058c2f340428a1b7ef22d71368f)](https://app.codacy.com/app/antho325/axios-curlirize?utm_source=github.com&utm_medium=referral&utm_content=delirius325/axios-curlirize&utm_campaign=Badge_Grade_Dashboard)\n[![CircleCI](https://circleci.com/gh/delirius325/axios-curlirize.svg?style=svg)](https://circleci.com/gh/delirius325/axios-curlirize)\n[![npm version](https://badge.fury.io/js/axios-curlirize.svg)](https://badge.fury.io/js/axios-curlirize)\n\n# Description\nThis module is an axios third-party module to log any axios request as a curl command in the console. It was originally posted as a suggestion on the axios repository, but since we believed it wasn't in the scope of axios to release such feature, we decided to make it as an independent module.\n\n# How it works\nThe module makes use of axios' interceptors to log the request as a cURL command. It also stores it in the response's config object. Therefore, the command can be seen in the app's console, as well as in the ```res.config.curlCommand``` property of the response.\n\n# Changing the logger\nBy default, axios-curlirize uses the `console.log/error()` functions. It is possible to change the logger by doing something similar to this:\n\n```javascript\n// when initiating your curlirize instance\ncurlirize(axios, (result, err) => {\n    const { command } = result;\n    if(err) {\n        // use your logger here\n    } else {\n        // use your logger here\n    }\n});\n```\n\n# How to use it\naxios-curlirize is super easy to use. First you'll have to install it.\n```shell\nnpm i --save axios-curlirize@latest\n```\nThen all you have to do is import and instanciate curlirize in your app. Here's a sample:\n\n```javascript\n    import axios from 'axios';\n    import express from 'express';\n    import curlirize from 'axios-curlirize';\n\n    const app = express();\n\n    // initializing axios-curlirize with your axios instance\n    curlirize(axios);\n\n    // creating dummy route\n    app.post('/', (req, res) => {\n        res.send({hello: 'world!'})\n    });\n\n    // starting server\n    app.listen(7500, () => {\n        console.log('Dummy server started on port 7500')\n        /*\n             The output of this in the console will be :\n             curl -X POST -H \"Content-Type:application/x-www-form-urlencoded\" --data {\"dummy\":\"data\"} http://localhost:7500/\n        */\n        axios.post('http://localhost:7500/', {dummy: 'data'})\n            .then((res) => {\n                console.log('success');\n            })\n            .catch((err) => {\n                console.log(err);\n            });\n    });    \n```\n","readmeFilename":"README.md"}