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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/bin.js +12 -7
  3. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # Usage is as follows
2
+ ```
3
+ npm i -g cc-codeline
4
+
5
+ codeline /path/
6
+ ```
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.table({
61
- '-h': 'Show help',
62
- '-l': 'Print log'
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('Path no found');
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('ReadDirectory ERROR');
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('ReadFile ERROR');
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.0",
4
- "main": "index.js",
5
- "describe": "Quickly count your lines of code",
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": "ISC",
11
+ "license": "MIT",
12
12
  "type": "commonjs"
13
13
  }