# unused-files-found

> ``` const chalk = require('chalk'); const findUnusedModule = require('./index'); const path = require('path');

Latest version **1.0.1** (published 2021-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install unused-files-found
pnpm add unused-files-found
yarn add unused-files-found
bun add unused-files-found
```

## 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.1 |
| Published | 2021-05-31 |
| First published | 2021-05-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 19 |
| Unpacked size | 30 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | iamqc |

## Links

- npm: https://www.npmjs.com/package/unused-files-found
- npm.io page: https://npm.io/package/unused-files-found

## Dependencies (19)

- [add](https://npm.io/package/add.md) ^2.0.6
- [acorn](https://npm.io/package/acorn.md) ^8.2.4
- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [postcss](https://npm.io/package/postcss.md) ^8.2.12
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.5
- [@babel/cli](https://npm.io/package/@babel/cli.md) *
- [source-map](https://npm.io/package/source-map.md) ^0.7.3
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.4.0
- [postcss-less](https://npm.io/package/postcss-less.md) ^4.0.1
- [postcss-scss](https://npm.io/package/postcss-scss.md) ^3.0.5
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.13.16
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) ^7.13.17
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.1.6
- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^7.14.0
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.4.0
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.2.0
- [@babel/plugin-syntax-dynamic-import](https://npm.io/package/@babel/plugin-syntax-dynamic-import.md) ^7.2.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.2.1
- [@babel/plugin-transform-modules-commonjs](https://npm.io/package/@babel/plugin-transform-modules-commonjs.md) ^7.4.0

## Recent versions

- 1.0.1 (latest) — 2021-05-31
- 1.0.0 — 2021-05-31

## README

```
const chalk = require('chalk');
const findUnusedModule = require('./index');
const path = require('path');

const { all, used, unused } = findUnusedModule({
    cwd: process.cwd(),//根目录
    entries: ['./demo-project/fre.js', './demo-project/suzhe2.js'],
    includes: ['./demo-project/**/*'],//glob加的一些过滤条件
    resolveRequirePath (curDir, requirePath) {//自定义规则
        if (requirePath === 'b') {
            return path.resolve(curDir, './lib/ssh.js');
        }
        return requirePath;
    }
});

console.log(chalk.blue('used modules:'));
console.log(used);
console.log(chalk.yellow('unused modules:'));
console.log(unused);
```

>PS:
>主要是运维工具  
>demo-project是用于测试的项目  
>其中require('./index')用于本地测试  
>用户使用的话直接npm i unused-files-found

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