1.0.6 • Published 1 year ago

@juln/curl-to-json v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

curl-to-json

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

CURL

Contributing

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

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

Thanks!

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago