forked from joshmarinacci/node-pureimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeasure.js
More file actions
37 lines (31 loc) · 985 Bytes
/
measure.js
File metadata and controls
37 lines (31 loc) · 985 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
var fs = require('fs');
var file = fs.readFileSync(process.argv[2]).toString();
console.log('chars = ',file.length);
var lines = file.split('\n');
console.log('lines = ',lines.length);
var code = lines.filter(function(line){
//comments
if(line.match(/^\s*\/\//)) {
return false;
}
if(line.match(/^\s*$/)) {
return false;
}
return true;
});
console.log('code lines = ',code.length);
/*
added selection support
2014-08-20: 416, 414,
403 (remove tree dump)
398 (inlined calcSize)
411 (added unified bg and text block)
406 (automate setting default text properties)
445 (add clipboard, fix selection markers, condense line breaking code)
390 (removed block system)
376 (switch to pair system, more cleanup)
340 (more cleanup, remove some chaining returns)
2014-08-27:
391: after adding bunch of new stuff, did a bunch of cleanup
397: moved selection, clipboard, and cursor into their own classes
*/