├── .gitignore
├── .prettierrc
├── README.md
├── README_zh-CN.md
├── bin
└── parser.js
├── dir-info.txt
├── images
├── demo.png
└── dir-parser.jpg
├── index.d.ts
├── index.js
├── myapp
├── app.js
├── bin
│ └── www
├── dir-info.txt
├── info.txt
├── package.json
├── parser.conf.json
├── public
│ └── stylesheets
│ │ └── style.css
├── routes
│ ├── index.js
│ └── users.js
├── test.js
└── views
│ ├── error.jade
│ ├── index.jade
│ └── layout.jade
├── package.json
├── parser.conf.json
├── src
├── base.js
└── dir-parser.js
└── test
└── test.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | package-lock.json
3 | yarn.lock
4 | **/.DS_Store
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "singleQuote": true,
4 | "semi": false,
5 | "tabWidth": 2,
6 | "trailingComma": "es5"
7 | }
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
😎 Dir Parser v2 😎
2 |
3 |
4 |
5 |
6 | # dir-parser
7 |
8 | [](https://www.npmjs.com/package/dir-parser)
9 | [](https://www.npmjs.com/package/dir-parser)
10 | [](https://npmcharts.com/compare/dir-parser?minimal=true)
11 | [](https://packagephobia.now.sh/result?p=dir-parser)
12 |
13 | > Parse a directory and generate it's structure tree.
14 |
15 | Read this in other languages: English | [简体中文](./README_zh-CN.md)
16 |
17 | - [dir-parser](#dir-parser)
18 | - [1. What is dir-parser](#1-what-is-dir-parser)
19 | - [1.1 Introduction](#11-introduction)
20 | - [1.2 Installation](#12-installation)
21 | - [2. Command Line](#2-command-line)
22 | - [2.1 Print help info](#21-print-help-info)
23 | - [2.2 Generate dir-tree](#22-generate-dir-tree)
24 | - [2.3 With parameters](#23-with-parameters)
25 | - [2.3.1 excludes](#231-excludes)
26 | - [2.3.2 ignores](#232-ignores)
27 | - [2.3.3 glob](#233-glob)
28 | - [2.3.4 patterns](#234-patterns)
29 | - [2.3.5 lineType](#235-lineType)
30 | - [2.3.6 depth](#236-depth)
31 | - [2.3.7 reverse](#237-reverse)
32 | - [2.3.8 fileFirst](#238-fileFirst)
33 | - [2.3.9 fileOnly](#239-fileOnly)
34 | - [2.3.10 dirOnly](#2310-dirOnly)
35 | - [2.3.11 dirInfo](#2311-dirInfo)
36 | - [2.3.12 excPaths](#2312-excPaths)
37 | - [2.3.13 excPatterns](#2313-excPatterns)
38 | - [2.3.14 silent](#2314-silent)
39 | - [2.3.15 generate](#2315-generate)
40 | - [2.3.16 config](#2316-config)
41 | - [2.4 Use multiple commands together](#24-use-multiple-commands-together)
42 | - [3. In JavaScript](#3-in-javascript)
43 | - [3.1 Interface](#31-interface)
44 | - [3.1.1 Main Function-parser](#311-main-function-parser)
45 | - [3.1.2 Options](#312-options)
46 | - [3.1.3 Parsed](#313-parsed)
47 | - [3.1.4 DirInfo](#314-dirinfo)
48 | - [3.1.5 FileInfo](#315-fileinfo)
49 | - [3.2 Get dir-tree](#32-get-dir-tree)
50 | - [3.2.1 Make dir-tree example](#321-make-dir-tree-example)
51 | - [3.2.2 Run dir-tree example](#322-run-dir-tree-example)
52 | - [3.3 Get dir-info](#33-get-dir-info)
53 | - [3.3.1 Make dir-info example](#331-make-dir-info-example)
54 | - [3.3.2 Run dir-info example](#332-run-dir-info-example)
55 | - [3.3.3 Make dir-children example](#333-make-dir-children-example)
56 | - [3.3.4 Run dir-children example](#334-run-dir-children-example)
57 | - [3.3.5 Make dir-files example](#335-make-dir-files-example)
58 | - [3.3.6 Run dir-files example](#336-run-dir-files-example)
59 |
60 | ## 1. What is dir-parser
61 |
62 | ### 1.1 Introduction
63 | 👍👍👍Dir parser is a powerful folder analysis tool based on nodejs, which can be used in command line or JavaScript code. There are many practical parameters that can be set to help you get the formatted folder tree and internal information.
64 |
65 | ### 1.2 Installation
66 |
67 | #### 1.2.1 Global install
68 | - yarn: `$ yarn global add dir-parser`
69 | - npm: `$ npm install -g dir-parser`
70 |
71 | #### 1.2.2 Local install
72 | - yarn: `$ yarn add dir-parser` or `$ yarn add dir-parser -D`
73 | - npm: `$ npm install dir-parser` or `$ npm install dir-parser -D`
74 |
75 | ## 2. Command Line
76 |
77 | ### 2.1 Print help info
78 | `$ parser -h` (or: `$ parser --help`)
79 | ```
80 | Usage: parser [options]
81 |
82 | Options:
83 | -V, --version output the version number
84 | -v, --version output the version number
85 | -c, --config [config] config file, Optional.
86 | -i, --input target directory (default: "./")
87 | -o, --output