Socket
Socket
Sign inDemoInstall

@gradeup/med-url

Package Overview
Dependencies
0
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @gradeup/med-url

Construct a url by passing query params as encoded uri or get the keys embedded into url as decoded values.


Version published
Maintainers
5
Created

Readme

Source

med-url

Construct a url by passing query params as encoded uri or get the keys embedded into url as decoded values.

Installation

npm install --save med-url

Usage

Import the module to your code

import MedUrl from 'med-url'; // Functionalities to MedUrl variable

Functions

set(url, options)
MedUrl.set(url, options)

Folowing are the params to be passed :

optionused for
urlUrl or object for construction of url
optionsObject for passing query params
get(url, key)
MedUrl.get(url, key)

Folowing are the params to be passed :

optionused for
urlUrl or object for construction of url
keyKey for getting value of a parameter

Usage

MedUrl.set('https://google.co', { query: { a: 1, b: 'site' } })
// "https://google.co?a=1&b=site"
MedUrl.set('https://google.co?c=89', { query: { a: 1, b: 'site' } })
// "https://google.co?c=89&a=1&b=site"
MedUrl.set('https://google.co?c=89', { query: { a: 1, b: 'site google' } })
// "https://google.co?c=89&a=1&b=site%20google"
MedUrl.get("https://google.co?c=89&a=1&b=site%20google")
// {c: "89", a: "1", b: "site google"}
MedUrl.get("https://google.co?c=89&a=1&b=site%20google", "d")
// undefined
MedUrl.get("https://google.co?c=89&a=1&b=site%20google", "c")
// "89"

You can visit some links for reference:

  • Github Link For Repo
  • Npm Link for the module

Organisation

Gradeup

Keywords

FAQs

Last updated on 10 Apr 2019

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