# nv-facutil-simple-path

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

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

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## 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 | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |
| Keywords | path, util, simple |

## Links

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

## Dependencies (2)

- [nv-array-include](https://npm.io/package/nv-array-include.md) ^1.0.1
- [nv-facutil-basic](https://npm.io/package/nv-facutil-basic.md) ^1.3.5

## 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.10 — 2022-10-29
- 0.0.9 — 2022-10-29
- 0.0.8 — 2022-10-28
- 0.0.7 — 2022-10-28
- 0.0.6 — 2022-05-19
- 0.0.5 — 2021-07-09
- 0.0.3 — 2021-07-09
- 0.0.2 — 2021-05-09

## README

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


install
=======
- npm install nv-facutil-simple-path 

usage
=====

    const fac_spath = require("nv-facutil-simple-path");

    Dir:  end-with "/"
     

    
example
-------

      const {Dir,Path} = require("nv-facutil-simple-path");


new
----

    var p = new Path("/a/b/c.ext")
    > p
    /a/b/c.ext
    >



getter
------

    > p.sp_
    '/'
    > p.extsp_
    '.'
    > p.dir_
    /a/b/
    > p.fname_
    'c.ext'
    > p.name_
    'c'
    > p.ext_
    'ext'
    >



IS
------


    > p.is_dir()
    false
    > p.is_file()
    true
    >

    > p.is_abs()
    true
    > p.is_rel()
    false
    >


MODIFY
------


### name and .ext

    > p.name_ = 'cccc'
    'cccc'
    > p
    /a/b/cccc.ext
    > p.ext_ = "jpg"
    'jpg'
    > p
    /a/b/cccc.jpg
    > p.dump()
    '/a/b/cccc.jpg'
    >

### dir


#### prepend append

    > p.dir_.append("append")
    > p
    /a/b/append/cccc.jpg
    > p.dir_.prepend("prepend")
    > p
    /prepend/a/b/append/cccc.jpg
    >


#### replace

    > p.dir_.rplc(2,'bbbbb')
    undefined
    > p
    /prepend/a/bbbbb/append/cccc.jpg
    >

#### relativize absolutize

    > p.dir_.relize()
    > p
    prepend/a/bbbbb/append/cccc.jpg
    > p.is_rel()
    true
    > p.is_abs()
    false
    >


#### remove

    > p
    prepend/a/bbbbb/append/cccc.jpg
    > p.dir_.rm(1)
    'a'
    > p
    prepend/bbbbb/append/cccc.jpg
    >


#### insert-before and insert-after

    // insert before
    > p.dir_.ibfr(1,'AAA')
    undefined
    > p
    prepend/AAA/bbbbb/append/cccc.jpg

    //insert after
    > p.dir_.iaft(2,'BBB')
    undefined
    > p
    prepend/AAA/bbbbb/BBB/append/cccc.jpg
    >


### rel

        > var xx = new Path("/a/b/c/")
        > var yy = new Path("/a/b/c/d/x.jpg")
        > yy.rel(xx)
        d/x.jpg



METHODS
=======

Path
----

    p.dir_                  
    p.sp_
    p.fname_                               
    p.name_                 
    p.extsp_
    p.ext_                  
    
    p.is_abs    p.is_rel 
    p.is_dir    p.is_file
    
    p.dump
    p.rel(p1)
    

Dir
----

    p.dir_.absize                p.dir_.append                p.dir_.dump
    p.dir_.fst_                  p.dir_.iaft                  p.dir_.ibfr                  p.dir_.is_abs
    p.dir_.is_rel                p.dir_.lst_                  p.dir_.lsti_                 p.dir_.pl_
    p.dir_.prepend               p.dir_.relize                p.dir_.rm                    p.dir_.rplc
    p.dir_.sp_                   p.dir_.which
    
    
API
====
    


LICENSE
=======
- ISC

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