open-index/open-npm huggingface dataset:
npm package: @orez/fs-tree-json
Description: Convert directory tree to json.
Author: justorez
Latest version: 1.2.0

# fs-tree-json

Convert directory tree to json.

## How to use

### Install

```sh
npm i @orez/fs-tree-json -g
```

or

```sh
npm i @orez/fs-tree-json
```

### Usage

#### 1. Command Line

```sh
treejson d:/a a.json

# Exclude txt, png files
treejson d:/a a.json -e txt -e png

# Print on the console
treejson d:/a -p
```

```
D:\a
|   1.txt
|   2.txt
|   
\---b
        x.txt
        y.txt
```

`a.json`

```json
{
    "path": "d:/a",
    "name": "a",
    "children": [
        {
            "path": "d:\\a\\1.txt",
            "name": "1.txt"
        },
        {
            "path": "d:\\a\\2.txt",
            "name": "2.txt"
        },
        {
            "path": "d:\\a\\b",
            "name": "b",
            "children": [
                {
                    "path": "d:\\a\\b\\x.txt",
                    "name": "x.txt"
                },
                {
                    "path": "d:\\a\\b\\y.txt",
                    "name": "y.txt"
                }
            ]
        }
    ]
}
```

#### 2. Module

```js
const treeJson = require('@orez/fs-tree-json')
const json = treeJson('d:/a')
```
npm package: @orez/jfind
Description: Fast search in multiple files.
Author: justorez
Latest version: 1.0.1

# jfind

Search the content of all files located within a designated directory.

## Usage

### Command Line

```sh
pnpm i @orez/jfind -g
```

Find "hello" in all txt files in the current directory, and ignore case sensitivity.

```sh
jfind . -p hello -f *.txt -i
```

Complex matching rules

The command line cannot directly input complex regular expressions. So, don't set `p`, instead of whole line input.

```sh
jfind . -f *.txt -i
Input complex pattern: ^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$
```

### Module

```sh
pnpm i @orez/jfind -S
```

```js
import jfind from '@orez/jfind'

jfind.find(/hello/ig, '.', '*.txt')
    .then(results => console.log(results))

// results
[
  {
    filename: 'test\\2.txt',
    matches: [ 'Hello' ],
    lines: [ "Hello! I'm justorez." ]
  }
]
```