1.1.3 • Published 7 years ago

query-str v1.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Travis Codecov Codacy Badge npm

query-str

Parse and stringify URL query strings with ease. 🚀

Installation ⬇️

$ npm install --save query-str

API Usage 📝

Parse query string with URL

const qs = require('query-str');

const myURL = 'http://foo.bar/buzz?myBool=true&myInt=2&myFloat=3.3&myString=fizz%20buzz';
qs.parse(myURL);
// => { myBool: true, myInt: 2, myFloat: 3.3, myString: 'fizz buzz' }

Parse query string

const qs = require('query-str');

const myURL = 'isOpenSource=true&isPassing=true&codacyScore=10.0';
qs.parse(myURL);
// => { isOpenSource: true, isPassing: true, codacyScore: 10.0 }

Stringify parameter object with URL

const qs = require('query-str');

const myURL = 'https://foo.bar/buzz';

const myParams = {
  fin: false,
  bazz: 22
};

qs.stringify(myParams, myURL);
// => 'https://foo.bar/buzz?fin=false&bazz=22'

Stringify parameter object

const qs = require('query-str');

const myParams = {
  myBool: false,
  myInt: 6,
  myFloat: 3.3,
  myString: 'fin fun'
};

qs.stringify(myParams);
// => '?myBool=false&myInt=6&myFloat=3.3&myString=fin%20fun'
1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago