js-query-string
Simple Javascript module, with no dependencies, to serialise native JS objects to be used in URL parameters. Objects and arrays are seralised as JSON strings to allow for easy representation of nested objects.
Can be installed very simply with:
npm install js-query-string
Example usage:
var jsq = ; var qs_object = str: "mystr" second_str: "myotherstr"; var qs_object2 = obj1: a: 1 b: "string" obj2: c: true b: 12 ; console; // ?str=mystr&second_str=myotherstrconsole; // ?obj1=%7B%22a%22%3A1%2C%22b%22%3A%22string%22%7D&obj2=%7B%22c%22%3Atrue%2C%22b%22%3A%5B1%2C2%5D%7D
Parameters are also encoded for URLs. The following datatypes are supported: RegExp, Object, Array, Number, String, Boolean.