Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/fs/eol.ts>format

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function format
import { format } from "https://deno.land/std@0.219.1/fs/eol.ts";

Format the file to the targeted EOL.

Examples

Example 1

import { LF, format } from "https://deno.land/std@0.219.1/fs/mod.ts";

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

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

Parameters

content: string
eol: EOL

Returns

string