Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chaitin/querystring

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chaitin/querystring

Parse and stringify URL query strings

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

querystring

Build Status Commitizen friendly

Parse and stringify URL query strings. Forked from query-string

Install

yarn add @chaitin/querystring

Usage

import { parse, stringify } from '@chaitin/querystring'

const result = parse("foo=foo&foo&foo=one&foo=&bat=buz")
// the result is:
{ bat: "buz", foo: ["foo", null, "one", ""] }

// result is sorted by key
let qs = stringify({
  page: "10",
  pageSize: 200,
  filter: ["aaa", "bbb", "ccc", 255]
})
qs === "filter=aaa&filter=bbb&filter=ccc&filter=255&page=10&pageSize=200"

// and you can disable sorting
qs = stringify({
  page: "10",
  pageSize: 200,
  filter: ["aaa", "bbb", "ccc", 255]
}, { sort: false })
qs === "page=10&pageSize=200&filter=aaa&filter=bbb&filter=ccc&filter=255"

License

MIT

FAQs

Package last updated on 01 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc