This package has been deprecated

Author message:

No longer maintained

wincurl

1.1.0 • Public • Published

WinCurl

A tool to convert your macOS/Linux cURL requests to a Windows equivalent.

Build Status Coverage Status NPM Licence

WinCurl trims whitespace, escapes bad characters, replaces quotes, and replaces line continuation characters for Windows. Requires Javascript to be enabled in your web browser.

Install

Install the node module below or download the Javascript manually.

npm i wincurl

Usage

There are multiple ways to take advantage of WinCurl. Below is an example of what to expect.

Take this:

curl -X POST https://api.easypost.com/v2/shipments \
    -u <YOUR_TEST/PRODUCTION_API_KEY>: \
    -d 'shipment[to_address][id]=adr_...' \
    -d 'shipment[from_address][id]=adr_...' \
    -d 'shipment[parcel][id]=prcl_...' \
    -d 'shipment[options][address_validation_level]=0'

And turn it into this:

curl -X POST https://api.easypost.com/v2/shipments ^
-u <YOUR_TEST/PRODUCTION_API_KEY>: ^
-d "shipment[to_address][id]=adr_..." ^
-d "shipment[from_address][id]=adr_..." ^
-d "shipment[parcel][id]=prcl_..." ^
-d "shipment[options][address_validation_level]=0"

Website

View WinCurl in action here: https://justintime50.github.io/wincurl.

Manual Download

Download WinCurl and open the index.html file in your browser (double click the file) and paste in your cURL request. Press convert and you'll have your Windows curl request output.

HTML Example

Use id's wincurl-input and wincurl-output to pass in curl data and get the converted data out.

<!-- Import WinCurl -->
<script src="path/to/wincurl/index.js"></script>
 
<!-- WinCurl Input -->
<textarea id="wincurl-input" placeholder="Paste curl request here..." rows="8"></textarea>
<button onclick="processInput()">Convert</button>
 
<!-- WinCurl Output -->
<div id="wincurl-output"></div>

Development

# Lint the project 
npx eslint index.js
 
# Test the project 
npm run test

Attribution

Source code came from roehnan with some small modifications.

Package Sidebar

Install

npm i wincurl

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

8.63 kB

Total Files

9

Last publish

Collaborators

  • justintime50