cc-codeline 1.0.0 → 1.0.2
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.
- package/README.md +6 -0
- package/bin.js +12 -7
- package/package.json +5 -5
package/README.md
ADDED
package/bin.js
CHANGED
|
@@ -24,6 +24,9 @@ const languages = {
|
|
|
24
24
|
'.vue': {
|
|
25
25
|
comment: /\/\*[\s\S]+?\*\/|\/\/.*|<!--[\s\S]+?-->/g
|
|
26
26
|
},
|
|
27
|
+
'.java': {
|
|
28
|
+
comment: /\/\*[\s\S]+?\*\/|\/\/.*/g
|
|
29
|
+
},
|
|
27
30
|
'.rs': {
|
|
28
31
|
comment: /\/\*[\s\S]+?\*\/|\/\/.*/g
|
|
29
32
|
},
|
|
@@ -57,10 +60,12 @@ const path = join(base, param[0] || '');
|
|
|
57
60
|
|
|
58
61
|
(() => {
|
|
59
62
|
if (param.includes('-h')) {
|
|
60
|
-
console.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
console.log(`
|
|
64
|
+
codeline /path/ -l
|
|
65
|
+
------------------
|
|
66
|
+
-h Show help
|
|
67
|
+
-l Print log
|
|
68
|
+
`);
|
|
64
69
|
return;
|
|
65
70
|
}
|
|
66
71
|
try {
|
|
@@ -75,7 +80,7 @@ const path = join(base, param[0] || '');
|
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
} catch (_) {
|
|
78
|
-
console.log('
|
|
83
|
+
console.log('Error, the path may not exist');
|
|
79
84
|
}
|
|
80
85
|
})();
|
|
81
86
|
|
|
@@ -93,7 +98,7 @@ function readDirectory(dirPath, callback) {
|
|
|
93
98
|
let progress = 0;
|
|
94
99
|
fs.readdir(dirPath, (err, filenames) => {
|
|
95
100
|
if (err) {
|
|
96
|
-
console.log('
|
|
101
|
+
console.log('Error reading directory');
|
|
97
102
|
callback();
|
|
98
103
|
return;
|
|
99
104
|
}
|
|
@@ -131,7 +136,7 @@ function readFile(filepath, callback) {
|
|
|
131
136
|
}
|
|
132
137
|
fs.readFile(filepath, (err, data) => {
|
|
133
138
|
if (err) {
|
|
134
|
-
console.log('
|
|
139
|
+
console.log('Error reading file');
|
|
135
140
|
callback();
|
|
136
141
|
return;
|
|
137
142
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-codeline",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"main": "bin.js",
|
|
5
|
+
"description": "Quickly count your lines of code",
|
|
6
6
|
"bin": {
|
|
7
7
|
"codeline": "./bin.js"
|
|
8
8
|
},
|
|
9
|
-
"keywords": [],
|
|
9
|
+
"keywords": ["codeline"],
|
|
10
10
|
"author": "",
|
|
11
|
-
"license": "
|
|
11
|
+
"license": "MIT",
|
|
12
12
|
"type": "commonjs"
|
|
13
13
|
}
|