Socket
Socket
Sign inDemoInstall

query-str

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    query-str

A tool kit for parsing/generating query strings


Version published
Weekly downloads
180
decreased by-13.46%
Maintainers
1
Install size
12.4 kB
Created
Weekly downloads
 

Readme

Source

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'

Keywords

FAQs

Last updated on 16 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc