# nv-facutil-simple-url

> nv-facutil-simple-url ====================== - nv-facutil-simple-url - simple util of url, same as url.parse, more easy to use

Latest version **0.0.12** (published 2022-10-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-facutil-simple-url
pnpm add nv-facutil-simple-url
yarn add nv-facutil-simple-url
bun add nv-facutil-simple-url
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2022-10-29 |
| First published | 2021-05-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |
| Keywords | url, simple, util |

## Links

- npm: https://www.npmjs.com/package/nv-facutil-simple-url
- npm.io page: https://npm.io/package/nv-facutil-simple-url

## Dependencies (2)

- [nv-facutil-basic](https://npm.io/package/nv-facutil-basic.md) ^1.3.20
- [nv-facutil-simple-path](https://npm.io/package/nv-facutil-simple-path.md) ^0.0.12

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.12 (latest) — 2022-10-29
- 0.0.11 — 2022-10-29
- 0.0.6 — 2022-10-28
- 0.0.5 — 2022-10-28
- 0.0.4 — 2022-10-28
- 0.0.3 — 2022-10-28
- 0.0.2 — 2021-09-20
- 0.0.1 — 2021-05-09

## README

nv-facutil-simple-url
======================
- nv-facutil-simple-url  
- simple util of url, same as url.parse, more easy to use


install
=======
- npm install nv-facutil-simple-url 

usage
=====

    const SURL = require("nv-facutil-simple-url");

     

    
example
-------


    var url = new SURL("https://name:passwd@www.ggl.com/a/b/c/?k1=v1&k0=v0#frag")
    /*

    > url.json()
    {
      protocol: 'https',
      username: 'name',
      password: 'passwd',
      hostname: 'www.ggl.com',
      port: '',
      path: [ 'a', 'b', 'c' ],
      query: { k1: 'v1', k0: 'v0' },
      hash: 'frag'
    }
    >
    */

    var url = new SURL({
      protocol: 'https',
      username: 'name',
      password: 'passwd',
      hostname: 'www.ggl.com',
      port: '',
      path: [ 'a', 'b', 'c' ],
      query: { k1: 'v1', k0: 'v0' },
      hash: 'frag'
    })

    /*
    > url.dump()
    'https://name:passwd@www.ggl.com/a/b/c?k1=v1&k0=v0#frag'
    >
    */



    > url.http()
    undefined
    > url.dump()
    'http://name:passwd@www.ggl.com/a/b/c?k1=v1&k0=v0#frag'
    >
    > url.path
    /a/b/c/
    >
    > url.path.prepend('A')
    > url.dump()
    'http://name:passwd@www.ggl.com/A/a/b/c?k1=v1&k0=v0#frag'
    >
    > url.path.rplc(3,'CCC')
    undefined
    > url.dump()
    'http://name:passwd@www.ggl.com/A/a/b/CCC/B?k1=v1&k0=v0#frag'
    > url
    {
      protocol: 'http',
      username: 'name',
      password: 'passwd',
      hostname: 'www.ggl.com',
      port: '',
      path: [ 'A', 'a', 'b', 'CCC', 'B' ],
      query: { k1: 'v1', k0: 'v0' },
      hash: 'frag'
    }
    >

    > url.port = 8080
    8080
    > url
    {
      protocol: 'http',
      username: 'name',
      password: 'passwd',
      hostname: 'www.ggl.com',
      port: 8080,
      path: [ 'A', 'a', 'b', 'CCC', 'B' ],
      query: { k1: 'v1', k0: 'v0' },
      hash: 'frag'
    }
    > url.dump()
    'http://name:passwd@www.ggl.com:8080/A/a/b/CCC/B?k1=v1&k0=v0#frag'
    >
    > url.https()
    undefined
    > url.port=""
    ''
    > url.dump()
    'https://name:passwd@www.ggl.com/A/a/b/CCC/B?k1=v1&k0=v0#frag'
    > url
    {
      protocol: 'https',
      username: 'name',
      password: 'passwd',
      hostname: 'www.ggl.com',
      port: '',
      path: [ 'A', 'a', 'b', 'CCC', 'B' ],
      query: { k1: 'v1', k0: 'v0' },
      hash: 'frag'
    }
    >
    > url.path
    /A/a/b/CCC/B/
    > url.path.rm(1)
    'a'
    > url.dump()
    'https://name:passwd@www.ggl.com/A/b/CCC/B?k1=v1&k0=v0#frag'
    >

    > url.unpw()
    'name:passwd'
    > url.rm_unpw()
    undefined
    > url.dump()
    'https://www.ggl.com/A/b/CCC/B?k1=v1&k0=v0#frag'
    >



METHODS
=======

SURL
------

    url.dump                  url.json
    url.http                  url.https                 
                   
    url.protocol              
    url.rm_unpw              url.unpw
    url.username             url.password
    url.hostname             url.port
    url.path   
    url.query
    url.hash                


PATH
------

    url.path.absize                url.path.append                url.path.dump
    url.path.fst_                  url.path.iaft                  url.path.ibfr                  url.path.is_abs
    url.path.is_rel                url.path.lst_                  url.path.lsti_                 url.path.pl_
    url.path.prepend               url.path.relize                url.path.rm                    url.path.rplc
    url.path.sp_                   url.path.which



API
====
    


LICENSE
=======
- ISC

---
_Source: https://npm.io/package/nv-facutil-simple-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
