-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
80 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,42 @@ | ||
# source-code-diagnosis | ||
|
||
This is a grocery store based on the `Rust` tool class, mainly used for various unique analysis of source code, supporting multi-threading. | ||
|
||
## 如何安装 | ||
|
||
```bash | ||
# pnpm | ||
pnpm i @shined/source-code-diagnosis -D | ||
|
||
# npm | ||
npm i @shined/source-code-diagnosis -D | ||
|
||
# yarn | ||
yarn add @shined/source-code-diagnosis -D | ||
``` | ||
|
||
## getUsageOfDangerStrings | ||
|
||
Analyze the dangerous strings in the source code, usually used for third-party CDN detection. | ||
|
||
```ts | ||
import { getUsageOfDangerStrings } from "@shined/source-code-diagnosis"; | ||
import { getDangerStringsUsage } from "@shined/source-code-diagnosis"; | ||
|
||
let response = getUsageOfDangerStrings( | ||
let response = getDangerStringsUsage( | ||
["bootcss.com", "bootcdn.com", "polyfill.com", "polyfill.io"], | ||
{ | ||
cwd: "/Users/Pikachu/project", | ||
concurrency: 1, | ||
} | ||
); | ||
``` | ||
|
||
## getModuleMemberUsage | ||
|
||
Analyze the usage rate of module members, generally used to analyze the number of times the exported members of a third-party package are used. | ||
|
||
```ts | ||
const response = getModuleMemberUsage(["antd"], { | ||
cwd: "/Users/Pikachu/project", | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# source-code-diagnosis | ||
|
||
这是一个基于 `Rust` 工具类的杂货铺,主要用于对源码进行各种唯独的分析,支持多线程。 | ||
|
||
## 如何安装 | ||
|
||
```bash | ||
# pnpm | ||
pnpm i @shined/source-code-diagnosis -D | ||
|
||
# npm | ||
npm i @shined/source-code-diagnosis -D | ||
|
||
# yarn | ||
yarn add @shined/source-code-diagnosis -D | ||
``` | ||
|
||
## getUsageOfDangerStrings | ||
|
||
分析源码中存在的危险字符串,一般用于第三方 CDN 检测 | ||
|
||
```ts | ||
import { getDangerStringsUsage } from "@shined/source-code-diagnosis"; | ||
|
||
let response = getDangerStringsUsage( | ||
["bootcss.com", "bootcdn.com", "polyfill.com", "polyfill.io"], | ||
{ | ||
cwd: "/Users/Pikachu/project", | ||
concurrency: 1, | ||
} | ||
); | ||
``` | ||
|
||
## getModuleMemberUsage | ||
|
||
分析模块成员的使用率,一般用于分析一个第三方包的导出成员被使用的次数 | ||
|
||
```ts | ||
const response = getModuleMemberUsage(["antd"], { | ||
cwd: "/Users/Pikachu/project", | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters