UNPKG

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