Function format

  • Normalize the input string to the targeted EOL.

    Parameters

    • content: string

      The input string to normalize.

    • eol: "\n" | "\r\n"

      The EOL character(s) to normalize the input string to.

    Returns string

    The input string normalized to the targeted EOL.

    import { LF, format } from "@std/fs/eol";

    const CRLFinput = "deno\r\nis not\r\nnode";

    format(CRLFinput, LF); // "deno\nis not\nnode"