Display current song
This commit is contained in:
11
tools/check_counts.js
Normal file
11
tools/check_counts.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const fs = require('fs');
|
||||
const path = 'd:/Sites/Work/RadioCast/src/main.js';
|
||||
const s = fs.readFileSync(path,'utf8');
|
||||
const counts = {'(':0,')':0,'{':0,'}','[':0,']':0,'`':0,'"':0,"'":0};
|
||||
for (const ch of s) { if (counts.hasOwnProperty(ch)) counts[ch]++; }
|
||||
console.log('counts:', counts);
|
||||
// Also print last 50 characters and line count
|
||||
console.log('length:', s.length);
|
||||
const lines = s.split(/\r?\n/);
|
||||
console.log('lines:', lines.length);
|
||||
for (let i = Math.max(0, lines.length-20); i < lines.length; i++) console.log((i+1)+': '+lines[i]);
|
||||
Reference in New Issue
Block a user