httpBuildQuery()
Generate URL-encoded query string from the object (php's http_build_query() in JavaScript).
Installation:
$ npm install http-build-query
Usage:
var httpBuildQuery = ; // Simple usingvar obj = id: 777 message: 'hello' token: 'x2s7d'; ; // message=hello&id=777&token=x2s7d // Example #3 http_build_query() with complex arrays// from php documentation: http://php.net/manual/en/function.http-build-query.phpvar obj2 = user: name: 'Bob Smith' age: 47 sex: 'M' dob: '5/12/1956' pastimes: 'golf' 'opera' 'poker' 'rap' children: bobby: age: 12 sex: 'M' sally: age: 8 sex: 'F' '+0': 'CEO'; ;