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

query-object

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

query-object

A lightweight lib to work with query strings (< 1kb uglified)

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

query-object

CircleCI Commitizen friendly semantic-release

A lightweight lib to work with query strings (< 1kb uglified & gzipped)

Please note this small/opinionated does not support Arrays[], for those scenarios there are other libraries who can handle it pretty well!

Install

npm install --save query-object

API

The v3 has a totally new and simpler API. All previous methods from v2 has been deprecated in favor of parse/stringify:

parse(querystring: string)

Returns the current query string as a key/value object.

const queryObject = require('queryObject')

queryObject.parse('?foo=foo&bar=bar&baz')
// returns {foo: 'foo', bar: 'bar', baz: null}

queryObject.parse('?foo=foo');
// returns {foo: 'foo'}

stringify(params: object)

Returns a new string based on the provided object.

const queryObject = require('queryObject')

queryObject.stringify({ foo: 'foo' })
// returns 'foo=foo'

queryObject.stringify({ foo: 'foo', bar: null })
// returns 'foo=foo&bar'

License

MIT License

Keywords

FAQs

Package last updated on 20 Oct 2017

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