A powerful querystring parser to use with multidimensional arrays and objects
Getting Started
Install the module with: npm install superqs
var qs = ; qs; // "name=Christopher&born_at=2015-12-23T20:25:25.782Z&metadata[username]=chrisenytc"
Features
- Supports multi dimensional arrays and objects
- Converts values into their correct data types.
- Supports all data types:
strings
,integers
,booleans
,arrays
&objects
.
Documentation
.parse(body)
How to use this method
let qs = ; // parseqs // becomes -> string: 'value' date: Wed Dec 23 2015 21:42:09 GMT- yes: true no: false array: 12 object: a: 'hello' b: 'world' c: a: 34
.stringify(query)
How to use this method
let qs = ; // stringifylet result = qs; console// --> string=value&date=2015-12-23T23:42:09.248Z&yes=true&no=false&array=1&array=2&object[a]=hello&object[b]=world&object[c][a]=3&object[c][a]=4
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/chrisenytc/superqs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Fork it chrisenytc/superqs
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am "Add some feature"
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Support
If you have any problem or suggestion please open an issue here.
Credits
This is a fork of the project diet-qs. Give some respect to him.
License
Check here.