@bany/curl-to-json Conver curl to json format.
npm i @bany/curl-to-json
const parse = require('@bany/curl-to-json');
var out = parse(`your_curl`);
const parse = require('@bany/curl-to-json');
var out = parse(`curl -X GET 'http://localhost:3001/search?search=react&asdfa=asfdaf' \
--header 'xapi-key: 21432139847290402402190' \
--header 'Content-Type: text/html' \
--data-raw '{
"name": "string",
"name2": "string"
}'`);
console.log(out)
/**
{
method: 'GET',
header: {
'xapi-key': '21432139847290402402190',
'Content-Type': 'text/html'
},
url: 'http://localhost:3001/search',
origin: 'http://localhost:3001',
params: { search: 'react', asdfa: 'asfdaf' },
body: { name: 'string', name2: 'string' }
} */
- Check this gist
- Accept curl from Postman.
Welcome new issue or feature request.
If you want to colaborate check the project's issues.
- Fork the repository
- Implement your solution
- Commit
- Open a Pull Request
Thanks!