-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcloc.js
More file actions
37 lines (31 loc) · 687 Bytes
/
Copy pathcloc.js
File metadata and controls
37 lines (31 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { spawn } = require('child_process');
const exclude_folders = [
'node_modules',
'.git',
'.idea',
'NO_COMMIT',
'prototypes',
'build',
'dist',
'public',
'markup',
'.cache',
'migrations',
'fixtures',
'seeders',
'coverage',
'seo_report',
'.storybook',
'test-reports'
];
const exclude_ext = ['json'];
const cl = spawn('cloc', [`--exclude-dir=${exclude_folders.join(',')}`, `--exclude-ext=${exclude_ext.join(',')}`, '.']);
cl.stdout.on('data', data => {
console.log(`stdout: ${data}`);
});
cl.stderr.on('data', data => {
console.log(`stderr: ${data}`);
});
cl.on('close', code => {
console.log(`child process exited with code ${code}`);
});