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

  • 1.0.5
  • Source
  • npm
  • Socket score

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

URL Query Builder

Usage

// nodejs style
var URLQueryBuilder = require("url-query-builder");

// es6 way
import URLQueryBuilder from "url-query-builder";

// create instance
var q = new URLQueryBuilder("example.com");
// with initial query, can be string
var q1 = new URLQueryBuilder("example.com", "name=value"); // => example.com?name=value&
// or object
var q2 = new URLQueryBuilder("example.com", {
	"name": "value", 
	"name2": "value2"
}); // => example.com?name=value&name2=value2&


q.add("num1", 100) // => example.com?num1=100
	.add("num2", 200) // => example.com?num1=100&num2=200&
	.change("num1", 150) // => example.com?num1=150&num2=200&
	.delete("num2") // => example.com?num1=100&
	.add("num3", "300"); // => example.com?num1=100&num3=300&

q.getUrl() // => example.com?num1=100&num3=300&

Install

npm i url-query-builder

Test

  • use mocha.js and should.js
npm run test

Keywords

FAQs

Package last updated on 25 Mar 2016

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