mhw-curl-to-json
TypeScript icon, indicating that this package has built-in type declarations

1.2.9 • Public • Published

curl-to-json

Conver curl to json format.

Install

npm i @bany/curl-to-json

Usage

const parse = require('@bany/curl-to-json');

var out = parse(`your_curl`);

Example

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' }
} */

Projects using curl-to-json

Project Description Stars
Motrix A full-featured download manager. GitHub Repo stars

CURL

Contributing

Welcome new issue or feature request.

If you want to colaborate check the project's issues.

  1. Fork the repository
  2. Implement your solution
  3. Commit
  4. Open a Pull Request

Thanks!

Package Sidebar

Install

npm i mhw-curl-to-json

Weekly Downloads

1

Version

1.2.9

License

MIT

Unpacked Size

13.8 kB

Total Files

11

Last publish

Collaborators

  • hanbing88888888