🚀 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 - npm Package Compare versions

Comparing version
2.1.1
to
2.1.2
+1
-1
bin/parser.js

@@ -122,3 +122,3 @@ #!/usr/bin/env node

} else {
match = match.replace(',', ' ').split(' ');
match = match.replace(/,/mg, ' ').split(' ');
}

@@ -125,0 +125,0 @@ }

{
"name": "dir-parser",
"version": "2.1.1",
"version": "2.1.2",
"description": "Parse a directory and generate it's structure tree.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -40,3 +40,4 @@ <h1 align="center">😎 文件夹解析器[Dir Parser v2] 😎</h1>

- [2.3.15 配置文件-config](#2315-配置文件-config)
- [2.4 多个命令混合使用](#24-多个命令混合使用)
- [2.4 文件名称包含空格](#24-文件名称包含空格)
- [2.5 多个命令混合使用](#25-多个命令混合使用)
- [三、在Js代码中使用](#三在Js代码中使用)

@@ -400,3 +401,27 @@ - [3.1 方法接口](#31-方法接口)

### 2.4 多个命令混合使用
### 2.4 文件名称包含空格
`touch 'white space.txt'`<br>
`parser -e '["node_modules", "white space.txt"]'`
```
myapp ( directories: 7, Files: 10 )
├─ bin
│ └─ www
├─ public
│ ├─ images/
│ ├─ javascripts/
│ └─ stylesheets
│ └─ style.css
├─ routes
│ ├─ index.js
│ └─ users.js
├─ views
│ ├─ error.jade
│ ├─ index.jade
│ └─ layout.jade
├─ app.js
├─ package.json
└─ parser.conf.json
```
### 2.5 多个命令混合使用
`parser -e node_modules,bin -I views -d 2 -Nr`

@@ -403,0 +428,0 @@ ```

@@ -40,3 +40,4 @@ <h1 align="center">😎 Dir Parser v2 😎</h1>

- [2.3.15 config](#2315-config)
- [2.4 Use multiple commands together](#24-use-multiple-commands-together)
- [2.4 Name has white space](#24-name-has-white-space)
- [2.5 Use multiple commands together](#25-use-multiple-commands-together)
- [3. In JavaScript](#3-in-javascript)

@@ -400,3 +401,27 @@ - [3.1 Interface](#31-interface)

### 2.4 Use multiple commands together
### 2.4 Name has white space
`touch 'white space.txt'`<br>
`parser -e '["node_modules", "white space.txt"]'`
```
myapp ( directories: 7, Files: 10 )
├─ bin
│ └─ www
├─ public
│ ├─ images/
│ ├─ javascripts/
│ └─ stylesheets
│ └─ style.css
├─ routes
│ ├─ index.js
│ └─ users.js
├─ views
│ ├─ error.jade
│ ├─ index.jade
│ └─ layout.jade
├─ app.js
├─ package.json
└─ parser.conf.json
```
### 2.5 Use multiple commands together
`parser -e node_modules,bin -I views -d 2 -Nr`

@@ -403,0 +428,0 @@ ```

@@ -51,3 +51,3 @@ const fs = require('fs');

} else if (fn.typeVal(ptn, 'str')) {
return new RegExp(ptn.replace('.', '\\.').replace(/\*/mg, '.*'));
return new RegExp(ptn.replace(/(\*?)\.([\w\d]*\$+)$/, () => `${RegExp.$1 && '\.*' || ''}\.${RegExp.$2}`));
} else {

@@ -54,0 +54,0 @@ return '';