-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b911c9f
commit fd22bbb
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
# curl-parser-js | ||
**Final javascript size is 2.58kB only!!** | ||
|
||
Simple javascript library to parse `cUrl command` to `json object`. Regex based matching without adding any complex parser code/library. Can be used in `Node`, in any `frontend project` or as `standalone js file`. | ||
|
||
With the generated json object you may construct your own `ajax` call using your `favourite` library. | ||
|
||
## Usage | ||
|
||
### Standalone | ||
|
||
Add your script tag | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/parse-curl.js"></script> | ||
|
||
Parse your cmd | ||
|
||
const curlCmd = `curl 'http://server.com:5050/a/c/getName/?param1=pradeep¶m2=kumar¶m3=sharma'`; | ||
parse_curl_js.parse(curlCmd); | ||
|
||
Standalone Demo on [Codepen](https://codepen.io/marudhupandiyang/pen/jaXRYp?editors=0010) | ||
|
||
### Node/frontend projects who support modules importing. | ||
|
||
import Curlparser from 'curl-parser-js'; | ||
|
@@ -69,7 +83,6 @@ | |
} | ||
} | ||
|
||
|
||
## Roadmap | ||
|
||
1. Add plugins to generate request for different libraries. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters