friendly-querystring

JSON.stringify <-> JSON.parse your objects in a friendly readable query string format

Usage no npm install needed!

<script type="module">
  import friendlyQuerystring from 'https://cdn.skypack.dev/friendly-querystring';
</script>

README

friendly-querystring

JSON.stringify <-> JSON.parse your objects in a friendly readable query string format

Build Status

{
  people: [{
    name: { first: 'Bob' },
    age: 34
  }, [null, { hi: undefined }]]
}

stringifys to and parses back to

"people.0.name.first=Bob&people.0.age=34&people.1.0&people.1.1.hi=undefined"

Features

  • Automatic coercion of core literals (true, false, numbers, empty object, empty array) from their string value
  • Arrays
  • Empty Arrays and Objects
  • Nested Objects, including arrays

Installation

via bower

bower install friendly-querystring

or via npm

npm install friendly-querystring