dmgig / curlToGet

convert cURL calls to URLs with GET parameters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

curlToGet

An extremely basic library providing a utility method to convert curl command line syntax into a url with get parameters. Ignores all flags except for -d and --data. (Mostly a chance to play with node modules and npm.)

Installation

npm install https://github.com/dmgig/curlToGet.git

Usage

  var curltoget = require('curltoget')
      convert = curltoget.convert;

  var curl = 'curl -GL -d dog=Fido -d cat=Kitty -d horse=Banjo http://petznamez.net',
      url = convert(curl);

  console.log(url);
  // http://petznamez.net?dog=Fido&cat=Kitty&horse=Banjo

Tests

npm test

Release History

  • 0.1.0 Initial release
  • 0.1.1 allow long names

Acknowledgements

thanks to https://quickleft.com/blog/creating-and-publishing-a-node-js-module/

About

convert cURL calls to URLs with GET parameters


Languages

Language:JavaScript 96.6%Language:Makefile 3.4%