cybersaksham-npm-logs
Version:
This package generates npm logs efficiently
23 lines (20 loc) • 477 B
JavaScript
const chalk = require("chalk");
const print = (...statements) => {
let finalList = [
chalk.white.bgBlack("npm"),
chalk.yellowBright.bgBlack("WARN!"),
...statements,
];
console.log(finalList.join(" "));
};
module.exports.showWarning = ({ warnings = [], summary = [] } = {}) => {
warnings.forEach((warn) => {
print(chalk.yellow(warn));
});
if (summary.length > 0) {
console.log();
summary.forEach((log) => {
print(log);
});
}
};