analyze-codebase 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,11 +29,10 @@ const path = __importStar(require("path"));
29
29
  const traverseDirectory = async ({ directory, onFile, onDirectory, exclude, extensions, checkFileNames = true, }) => {
30
30
  const files = await fs.readdir(directory, { withFileTypes: true });
31
31
  const tasks = files.map(async (file) => {
32
+ var _a;
32
33
  const filePath = path.join(directory, file.name);
33
- if (exclude === null || exclude === void 0 ? void 0 : exclude.length) {
34
- if (exclude.includes(file.name))
35
- return;
36
- }
34
+ if ((_a = exclude === null || exclude === void 0 ? void 0 : exclude.includes) === null || _a === void 0 ? void 0 : _a.call(exclude, file.name))
35
+ return;
37
36
  if (file.isDirectory()) {
38
37
  onDirectory === null || onDirectory === void 0 ? void 0 : onDirectory(filePath);
39
38
  await (0, exports.traverseDirectory)({
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "https://github.com/mtahagocer/analyze-codebase"
7
7
  },
8
- "version": "1.0.2",
8
+ "version": "1.0.3",
9
9
  "main": "dist/index.js",
10
10
  "license": "MIT",
11
11
  "bin": {
@@ -16,18 +16,10 @@
16
16
  "start": "node ./dist/index.js",
17
17
  "compile": "npx rimraf dist && npx tsc"
18
18
  },
19
- "contributes": {
20
- "commands": [
21
- {
22
- "command": "extension.analyzeCode",
23
- "title": "Analyze Codebase"
24
- }
25
- ]
26
- },
27
19
  "devDependencies": {
28
20
  "@types/node": "^20.1.5",
29
- "typescript": "^5.0.4",
30
- "ts-node": "^10.9.1"
21
+ "ts-node": "^10.9.1",
22
+ "typescript": "^5.0.4"
31
23
  },
32
24
  "dependencies": {
33
25
  "chalk": "4.1.0",
package/readme.md CHANGED
@@ -21,12 +21,18 @@ You can install Codebase Analyzer globally using NPM:
21
21
  npm install -g analyze-codebase
22
22
  ```
23
23
 
24
+ or use with npx
25
+
26
+ ```bash
27
+ npx analyze-codebase ./MyProject --exclude node_modules dist --extensions .tsx .ts
28
+ ```
29
+
24
30
  ## Usage
25
31
 
26
32
  To analyze a directory, use the analyze command followed by the directory path. Here's an example:
27
33
 
28
34
  ```bash
29
- analyze-codebase analyze ./src
35
+ analyze-codebase ./MyProject --exclude node_modules dist --extensions .tsx .ts
30
36
  ```
31
37
 
32
38
  ## Options
@@ -45,31 +51,31 @@ analyze-codebase analyze ./src
45
51
  Analyze a directory with default options:
46
52
 
47
53
  ```bash
48
- analyze-codebase analyze ./src
54
+ analyze-codebase ./src
49
55
  ```
50
56
 
51
57
  Analyze a directory with a specified framework and file extensions:
52
58
 
53
59
  ```bash
54
- analyze-codebase analyze ./src -f react --extensions .js .jsx .ts .tsx
60
+ analyze-codebase ./src -f react --extensions .js .jsx .ts .tsx
55
61
  ```
56
62
 
57
63
  Exclude specific directories from the analysis:
58
64
 
59
65
  ```bash
60
- analyze-codebase analyze ./src --exclude node_modules dist
66
+ analyze-codebase ./src --exclude node_modules dist
61
67
  ```
62
68
 
63
69
  Analyze only file names
64
70
 
65
71
  ```bash
66
- analyze-codebase analyze ./src --exclude node_modules dist --checkFileContent=false
72
+ analyze-codebase ./src --exclude node_modules dist --checkFileContent=false
67
73
  ```
68
74
 
69
75
  Analyze only file content
70
76
 
71
77
  ```bash
72
- analyze-codebase analyze ./src --exclude node_modules dist --checkFileNames=false
78
+ analyze-codebase ./src --exclude node_modules dist --checkFileNames=false
73
79
  ```
74
80
 
75
81
  ## Contribution