querystring2json

1.1.2 • Public • Published

querystring to json

querystring to json & json to querystring

use in script

  • import index.js
    <script src="./lib/index.js"></script> 
 
  • example
    //parse
    let str="a=1&a=2&b=2&c=3&d=123&e=true"
    let obj=qs.parse(str); //{ a: [ '1', '2' ], b: '2', c: '3',d:123,e:true }
 
    //stringify
    let obj={ a: [ '1', '2' ], b: '2', c: '3',d:123,e:true };
    let str=qs.stringify(obj); //"a=1&a=2&b=2&c=3&d=123&e=true"

use in node

  • install
    npm i querystring2json
  • example
    const qs =require("querystring2json");
    let str="a=1&a=2&b=2&c=3&d=123&e=true";
    let obj=qs.parse(str);
    console.log(obj); //{ a: [ '1', '2' ], b: '2', c: '3',d:123,e:true }
    console.log(qs.stringify(obj)); //"a=1&a=2&b=2&c=3&d=123&e=true"

to develop

  • install
    npm install
  • test
    npm run test
  • build
    npm run build

Package Sidebar

Install

npm i querystring2json

Weekly Downloads

8

Version

1.1.2

License

ISC

Unpacked Size

9.98 kB

Total Files

13

Last publish

Collaborators

  • fooooooof