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

url-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-query-builder

Simple add/change/delete url query

  • 3.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
342
increased by67.65%
Maintainers
1
Weekly downloads
 
Created
Source

URL Query Builder

Install

npm i url-query-builder --save
yarn add url-query-builder --save

BREAKING CHANGES v3

  • rename method add to set
  • delete method change
  • rename method getUrl to get
  • rename static method getClearUrl to clearUrl

Usage

import URLQueryBuilder from 'url-query-builder'

// create instance
const q = new URLQueryBuilder('example.com') // => example.com?
// with query in url
const q1 = new URLQueryBuilder('example.com?a=b') // => example.com?a=b
// with query by param, can be string
const q2 = new URLQueryBuilder('example.com', 'a=b') // => example.com?a=b
// or object
const q3 = new URLQueryBuilder('example.com', {a: 'b'}) // => example.com?a=b

// add queries
// update queries
q.set('a', 'b') // => example.com?a=b
q.set({a: 'b'}) // => example.com?a=b

// delete queries
q.delete('a') // => example.com?

// reset queries
q.reset() // => example.com?
q.reset({a: 'b'}) // => example.com?a=b

// get queries
q.get(); // example.com?a=b

Keywords

FAQs

Package last updated on 14 Mar 2020

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