$ node ./removeDuplicateFilesCli.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SALARIO_MINIMO_MENSAL = 1320; | |
/** | |
* @param {number} valor | |
* @param {number} casaDecimais (para o valor `10.2345678`, usar 0 => 10, 1 => 10.2, 2 => 10.23, 3 => 10.235) | |
*/ | |
function arredondar(valor, casasDecimais) { | |
const multiplicador = Math.pow(10, casasDecimais); | |
return Math.round(valor * multiplicador) / multiplicador; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path"); | |
const crypto = require("crypto"); | |
const stream = require("stream/promises"); | |
const readline = require("readline"); | |
const { totalmem } = require("os"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} num | |
* @returns {string} | |
*/ | |
function formatMoney(num) { | |
return `R$ ${num | |
.toFixed(2) | |
.replace('.', ',') | |
.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1.')}`; | |
} |
OlderNewer