# nv-path-tree

> nv-path-tree ============ - nv-path-tree is very simple util to change paths to a tree

Latest version **1.1.2** (published 2025-12-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install nv-path-tree
pnpm add nv-path-tree
yarn add nv-path-tree
bun add nv-path-tree
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2025-12-12 |
| First published | 2022-01-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ihgazni2 |

## Links

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

## Dependencies (6)

- [nv-char-basic](https://npm.io/package/nv-char-basic.md) ^1.0.3
- [nv-array-defrag](https://npm.io/package/nv-array-defrag.md) ^1.0.2
- [nv-char-whitespace](https://npm.io/package/nv-char-whitespace.md) ^1.0.7
- [nv-data-tree-csp-l0](https://npm.io/package/nv-data-tree-csp-l0.md) ^1.0.15
- [nv-data-tree-csp-tuple-bw](https://npm.io/package/nv-data-tree-csp-tuple-bw.md) ^1.0.20
- [nv-data-tree-csp-tuple-tool](https://npm.io/package/nv-data-tree-csp-tuple-tool.md) ^1.0.11

## Recent versions

- 1.1.2 (latest) — 2025-12-12
- 1.1.1 — 2025-12-12
- 1.1.0 — 2024-06-27
- 1.0.4 — 2022-04-19
- 1.0.3 — 2022-04-19
- 1.0.1 — 2022-01-04

## README

nv-path-tree
============
- nv-path-tree is very simple util to change paths to a tree 




install
=======
- npm install nv-path-tree

usage
=====

       const {
            parse_one,
            paths_to_dict,
            dict_to_paths,
            load_from_paths,
            load_from_pls,
            load_from_dict,
       } = require("nv-path-tree")


example
-------



### parse\_one

     > parse_one.parse('a/b/c')
     [ 'a', 'b', 'c' ]
     >
     > parse_one.parse('a/b/c/')
     [ 'a', 'b', 'c', SP { sp: '/' } ]
     >
     > parse_one.parse('/a/b/c')
     [ '', 'a', 'b', 'c' ]
     >
     > parse_one.parse('/a/b/c/')
     [ '', 'a', 'b', 'c', SP { sp: '/' } ]
     >
     > parse_one.parse('/a/b/c/./d')
     [ '', 'a', 'b', 'c', 'd' ]
     >
     > parse_one.parse('/a/b/c/../d')
     [ '', 'a', 'b', 'd' ]
     > parse_one.parse('/a/b/c/.../d')
     [ '', 'a', 'd' ]
     > parse_one.parse('/a/b/c/..../d')
     [ '', 'd' ]
     > parse_one.parse('/a/b/c/...../d')
     [ 'd' ]
     > parse_one.parse('/a/b/c/....../d')
     [ 'd' ]
     >
     > parse_one.parse('/../b/c/../d')
     [ 'b', 'd' ]
     > parse_one.parse('../b/c/../d')
     [ 'b', 'd' ]
     >



### paths\_to\_dict

       var paths = [
         "/a/b/c",
         "/a/b/d"
       ]

       > paths_to_dict(paths)
       { a: { b: { c: null, d: null } } }
       >
       > paths_to_dict(paths,true)
       { a: { b: { c: '/a/b/c', d: '/a/b/d' } } }
       >


### dict\_to\_paths

       > dict_to_paths({ a: { b: { c: null, d: null } } })
       [ '/a/b/c', '/a/b/d' ]
       >
       > dict_to_paths({ a: { b: { c: '/a/b/c', d: '/a/b/d' } } })
       [ '/a/b/c', '/a/b/d' ]
       >


### load\_from\_paths

      var paths = [
       "/a/b/c",
       "/a/b/d"
      ]

      rt =load_from_paths(paths)

      > rt.$sdfs_
      [
        ‌ [/] { SP: ‌ { sp: '/' } },
        ‌ [/a/] {},
        ‌ [/a/b/] {},
        ‌ [/a/b/c] {},
        ‌ [/a/b/d] {}
      ]

      > rt.dict()
      { a: { b: { c: null, d: null } } }
      >
      > rt.dict(true)
      { a: { b: { c: '/a/b/c', d: '/a/b/d' } } }
      >

      > rt.entries()
      [ [ '/a/b/c', null ], [ '/a/b/d', null ] ]
      >
      > rt.entries(true)
      [ [ '/a/b/c', '/a/b/c' ], [ '/a/b/d', '/a/b/d' ] ]
      >


METHODS
=======

        rt.add_with_pl                             rt.constructor
        rt.del_with_pl                             rt.dict
        rt.entries                                 rt.get_with_pl
        rt.is_dir                                  rt.is_file
        rt.is_leaf_dir                             rt.is_nonleaf_dir
        rt.k_                                      rt.path_
        rt.paths_                                  rt.pl_
        rt.pls_                                    rt.rel_dict
        rt.rel_entries                             rt.rel_path
        rt.rel_paths                               rt.rel_pl
        rt.rel_pls                                 rt.sp_
        rt.to_dir                                  rt.to_file

        rt.SP


APIS
====

        {
          DFLT_CFG: [Function: DFLT_CFG],
          parse_one: {
            _parse: [Function: _parse],
            parse: [Function: parse],
            parse_trim_begin: [Function: parse_trim_begin],
            parse_trim_end: [Function: parse_trim_end],
            parse_trim_both: [Function: parse_trim_both]
          },
          paths_to_dict: [Function: paths_to_dict],
          dict_to_paths: [Function: dict_to_paths],
          load_from_paths: [Function: load_from_paths],
          load_from_pls: [Function: load_from_pls],
          load_from_dict: [Function: load_from_dict]
        }





LICENSE
=======
- ISC

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