INNER CODE UNIT · JavaScript

logWarning

waylaidwanderer/node-chatgpt-api · bin/cli.js:303

function logWarning(message) {
    console.log(tryBoxen(message, {
        title: 'Warning', padding: 0.7, margin: 1, borderColor: 'yellow',
    }));
}

/**
 * Boxen can throw an error if the input is malformed, so this function wraps it in a try/catch.
 * @param {string} input
 * @param {*} options
 */
function tryBoxen(input, options) {
    try {
        return boxen(input, options);
    } catch {
        return input;
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…