πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

dir-parser

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dir-parser

Parse a directory and generate it's structure tree.

Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
190
75.93%
Maintainers
1
Weekly downloads
Β 
Created
Source

Dir Parser

Parse a directory and generate it's structure tree.

Quick Start

Install dir-parser

$ npm install dir-parser -g

Get help

$ parse -h
Usage: index [options]
Options:
  -V, --version                output the version number
  -v, --version
  -d, --directory [directory]  The target directory, default: "./"
  -o, --output [output]        Parse result output path, default: "./"
  -e, --excludes [excludes]    Exclude some directories or files by name
  -x, --exdPaths [exdPaths]    Exclude some directories or files by path
  -c, --config [config]        Parser config file
  -s, --silent                 Don't print the parse-result in terminal
  -n, --noNum                  Don't show file and directory number
  -h, --help                   output usage information

Parse your dir

$ cd your/demo/dir
$ parse
# It will generate a text file: 'dir-info.txt';
# in terminal log:
dir
 β”œβ”€ subdir
 β”‚ └─ file1.txt
 β”œβ”€ subdir2
 β”‚ β”œβ”€ dem1
 β”‚ β”‚ └─ test1.txt
 β”‚ └─ dem2
 └─ README.md

With params

$ parse -e test1 -s
$ cat dir-info.txt
dir
 β”œβ”€ subdir2
 β”‚ β”œβ”€ dem1
 β”‚ β”‚ └─ test1.txt
 β”‚ └─ dem2
 └─ README.md

Recommend usage

# Usage 01
#Hint: There should no white space in the excludes series!
$ parse -e .git,node_modules -x somedir/somefile

# Usage 01
#Hint: There should no white space in the excludes Array!
$ parse -e ['.git','node_modules']  -x ['somedir/somefile'] 

# Usage 03
# Parse by a config file >> parser.json
{
  "directory": "your/demo/dir",
  "output": "your/output/dir",
  "excludes": [
    ".git",
    "node_modules"
  ]
}
$ parse -c ./parser.json

Keywords

dir-parser

FAQs

Package last updated on 05 Jan 2019

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