You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.9 KiB

  1. # node-querystring
  2. query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.
  3. ## Installation
  4. $ npm install qs
  5. ## Examples
  6. ```js
  7. var qs = require('qs');
  8. qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
  9. // => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
  10. qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
  11. // => user[name]=Tobi&user[email]=tobi%40learnboost.com
  12. ```
  13. ## Testing
  14. Install dev dependencies:
  15. $ npm install -d
  16. and execute:
  17. $ make test
  18. browser:
  19. $ open test/browser/index.html
  20. ## License
  21. (The MIT License)
  22. Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>
  23. Permission is hereby granted, free of charge, to any person obtaining
  24. a copy of this software and associated documentation files (the
  25. 'Software'), to deal in the Software without restriction, including
  26. without limitation the rights to use, copy, modify, merge, publish,
  27. distribute, sublicense, and/or sell copies of the Software, and to
  28. permit persons to whom the Software is furnished to do so, subject to
  29. the following conditions:
  30. The above copyright notice and this permission notice shall be
  31. included in all copies or substantial portions of the Software.
  32. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  33. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  34. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  35. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  36. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  37. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  38. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.