Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

uri-parse-lib

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uri-parse-lib

Small library for parsing URL.

latest
Source
npmnpm
Version
2.5.0
Version published
Weekly downloads
21
-55.32%
Maintainers
2
Weekly downloads
 
Created
Source

uri-parse-lib

Small library for parse URI(URL) for web/node

NPM

Try it

DEMO

What the difference with new URL(url)?

  • It is deeply parse search params like a object(check examples)
  • Check first one!(it is main once)

Install

npm install uri-parse-lib

Usage

import { parseURI } from "uri-parse-lib"`

parseURI("http://user:pass@example.com:8080/directory/file.ext?query[nan][0][nan]=1&query[nan][1][sed]=4&sed[tatat][rqwr]=5&query[nan][2][sed]=4#anchor");`
{
  "hash": "#anchor",
  "host": "example.com",
  "origin": "http://example.com:8080",
  "password": "pass",
  "pathname": "/directory/file.ext",
  "port": "8080",
  "protocol": "http",
  "query": {
    "query": {
      "nan": [
        {
          "nan": "1"
        },
        {
          "sed": "4"
        },
        {
          "sed": "4"
        }
      ]
    },
    "sed": {
      "tatat": {
        "rqwr": "5"
      }
    }
  },
  "user": "user"
}

Keywords

url

FAQs

Package last updated on 30 Sep 2021

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