How to use the wordwrap.soft function in wordwrap

To help you get started, we’ve selected a few wordwrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / rushstack / apps / rush-lib / src / utilities / Utilities.ts View on Github external
public static wrapWords(text: string, maxLineLength?: number, indent?: number): string {
    if (!indent) {
      indent = 0;
    }
    if (!maxLineLength) {
      maxLineLength = Utilities.getConsoleWidth();
    }

    const wrap: (textToWrap: string) => string = wordwrap.soft(indent, maxLineLength);
    return wrap(text);
  }

wordwrap

Wrap those words. Show them at what columns to start and stop.

MIT
Latest version published 9 years ago

Package Health Score

65 / 100
Full package analysis

Popular wordwrap functions