Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tj/parse-curl.js
Parse curl commands, returning an object representing the request.
https://github.com/tj/parse-curl.js
Last synced: 3 months ago
JSON representation
Parse curl commands, returning an object representing the request.
- Host: GitHub
- URL: https://github.com/tj/parse-curl.js
- Owner: tj
- Created: 2016-04-15T01:50:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-09-20T10:11:08.000Z (almost 2 years ago)
- Last Synced: 2023-11-07T15:16:35.831Z (8 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 218
- Watchers: 6
- Forks: 25
- Open Issues: 12
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Lists
- awesome-stars - tj/parse-curl.js - Parse curl commands, returning an object representing the request. (JavaScript)
README
# parse-curl.js
Parse curl commands, returning an object representing the request.
## Example
Input:
```
curl 'http://google.com/' \
-H 'Accept-Encoding: gzip, deflate, sdch' \
-H 'Accept-Language: en-US,en;q=0.8,da;q=0.6' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
-H 'Connection: keep-alive' \
--compressed
```Output:
```json
{
"method": "GET",
"header": {
"Accept-Encoding": "gzip, deflate, sdch",
"Accept-Language": "en-US,en;q=0.8,da;q=0.6",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Connection": "keep-alive"
},
"url": "http://google.com/"
}
```## Badges
![](https://img.shields.io/badge/license-MIT-blue.svg)
![](https://img.shields.io/badge/status-stable-green.svg)---
> [tjholowaychuk.com](http://tjholowaychuk.com) ·
> GitHub [@tj](https://github.com/tj) ·
> Twitter [@tjholowaychuk](https://twitter.com/tjholowaychuk)