UNPKG

792 BJavaScriptView Raw
1"use strict";
2
3const boxen = require(`boxen`);
4
5const defaultConfig = {
6 padding: 1,
7 borderColor: `blue`,
8 borderStyle: `double`
9};
10const defaultMessage = `Gatsby has started collecting anonymous usage analytics\n` + `to help improve Gatsby for all users.\n` + `\n` + `If you'd like to opt-out, you can use \`gatsby telemetry --disable\`\n` + `To learn more, checkout https://gatsby.dev/telemetry`;
11/**
12 * Analytics notice for the end-user
13 * @param {Object} config - The configuration that boxen accepts. https://github.com/sindresorhus/boxen#api
14 * @param {string} message - Message shown to the end-user
15 */
16
17const showAnalyticsNotification = (config = defaultConfig, message = defaultMessage) => {
18 console.log(boxen(message, config));
19};
20
21module.exports = showAnalyticsNotification;
\No newline at end of file