swap-lock-registry
Version:
A CLI tool to swap the registry URL in the lock file without having to remove it
26 lines (25 loc) • 887 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.logger = void 0;
const chalk_1 = require("chalk");
const readline_1 = require("readline");
class Logger {
clearLine() {
(0, readline_1.clearLine)(process.stdout, 0);
(0, readline_1.cursorTo)(process.stdout, 0);
}
progress(context, ...args) {
this.clearLine();
process.stdout.write(`${(0, chalk_1.blue)(`[${context}]`)} ${(0, chalk_1.yellow)(args)}`);
}
success(context, ...args) {
console.log((0, chalk_1.blue)(`[${context}]`), (0, chalk_1.green)(...args));
}
warning(context, ...args) {
console.log((0, chalk_1.blue)(`[${context}]`), (0, chalk_1.yellow)(...args));
}
error(context, ...args) {
console.error((0, chalk_1.blue)(`[${context}]`), (0, chalk_1.red)(...args));
}
}
exports.logger = new Logger();