Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let message = stripIndent`
Your Twilio Flex plugin project has been successfully created!${
!config.install ? `\n\n ${setupMessage}` : ''
}
${devMessage}
${buildMessage}
For more info check the README.md file or go to:
➡ https://www.twilio.com/docs/flex
`;
const columns = (process.stdout.columns || 100) - 14 /* boxen spacing */;
message = wrapAnsi(message, columns, { hard: true });
const boxedMessage = boxen(message, {
padding: 1,
margin: 1,
});
console.log(boxedMessage);
}
export const wrap = (input: string, columns: number, options = DefaultWrapOptions) => {
return wrapAnsi(input, columns, options);
};
ngrokInfo = chalk`{green.bold ngrok request inspector available:}\nhttp://127.0.0.1:4040`;
}
const output = [
functionHeading,
functionInfo,
'',
assetHeading,
assetInfo,
'',
ngrokInfo,
]
.join('\n')
.trim();
const wrappedOutput = wrapAnsi(output, windowSize.width - 8, {
wordWrap: true,
});
return boxen(wrappedOutput, { padding: 1 });
}
const wrapText = (text: string) =>
wrapAnsi(text, windowSize.width - 5, { trim: false });
export function centreText(text: string, width: number): string {
const wrappedLine: string = ansiAlign.center(wrapAnsi(text, width) + "\n" + " ".repeat(width));
return wrappedLine.substring(0, wrappedLine.lastIndexOf("\n"));
}
function wrapMessage(message, maxLabelWidth) {
const offsetWidth = maxLabelWidth + getWidth(message[1]) + 4
const width = process.stdout.columns - offsetWidth
return indent(wrap(message[2], width * 0.9), offsetWidth).trim()
}