# path-fs-demo

> ```js const path = require('path'); const fs = require('fs');

Latest version **1.0.0** (published 2020-11-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install path-fs-demo
pnpm add path-fs-demo
yarn add path-fs-demo
bun add path-fs-demo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-11-19 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | undefineds |

## Links

- npm: https://www.npmjs.com/package/path-fs-demo
- npm.io page: https://npm.io/package/path-fs-demo

## Recent versions

- 1.0.0 (latest) — 2020-11-19

## README

## 删除空文件夹
```js
const path = require('path');
const fs = require('fs');


//删除非空文件夹
//定义一个函数用来存放
const removedir = (pathdir) => {
    //读取文件夹
    const arr = fs.readdirSync(pathdir);
    //遍历所有的字目录
    arr.forEach(item => {
        //对路径进行拼接
        item = path.join(pathdir, item);
        //判断文件夹是否为空
        const info = fs.statSync(item).isFile();
        // 判断
        if (info) {
             //为文件 删除该文件
            fs.unlinkSync(item);
        } else {
            // 为文件夹  用调该函数 传的参数是每一项子目录
            removedir(item);
        }
    })
    // 删除完内部字目录之后删除文件夹
    fs.rmdirSync(pathdir);
}

removedir("six");
```

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