route -p add 192.168.1.0 mask 255.255.255.0 192.168.0.1
route -p add 192.168.0.0 mask 255.255.255.0 192.168.1.1
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v IPEnableRouter /t REG_DWORD /d 1 /f
function CSVToArray(strData, strDelimiter = ','){
const objPattern = new RegExp(
"(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
"(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
"([^\"\\" + strDelimiter + "\\r\\n]*))",
'gi'
);
const arrData = [[]];
let arrMatches = null;
while (arrMatches = objPattern.exec(strData)){
const strMatchedDelimiter = arrMatches[ 1 ];
if (
strMatchedDelimiter.length &&
strMatchedDelimiter !== strDelimiter
) {
arrData.push([]);
}
const strMatchedValue = arrMatches[2]
? arrMatches[2].replace(new RegExp("\"\"", 'g' ), "\"")
: arrMatches[3];
arrData[arrData.length - 1].push(strMatchedValue);
}
return( arrData );
}
console.log(CSVToArray('"a,b",a b,')); // Array(3) [ "a,b", "a b", "" ]
full => notice,warning,error,debug,verbose(5),dtmf
module reload logger
function shortNumber(val) {
const degree = Math.floor(Math.log10(val) / 3);
const suffix = ['', ' тыс.', ' млн', ' млрд'][degree];
const num = val / (10 ** (degree * 3));
return `${num.toFixed(num >= 10 ? 0 : 1)}${suffix}`;
}
shortNumber(123); // "123"
shortNumber(12345); // "12 тыс."
shortNumber(1234567); // "1.2 млн"