Skip to main content
The Deno 2 Release Candidate is here
Learn more
function fs.format
import { fs } from "https://deno.land/x/assert_fs@v0.1.0/deps.ts";
const { format } = fs;

Format the file to the targeted EOL.

Examples

Example 1

import { LF, format } from "https://deno.land/std@0.224.0/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