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

x/deno/std/prettier/vendor/standalone.d.ts

A modern runtime for JavaScript and TypeScript.
Go to Latest
import * as deno from "https://deno.land/x/deno@v0.22.0/std/prettier/vendor/standalone.d.ts";

Functions

check checks to see if the file has been formatted with Prettier given those options and returns a Boolean. This is similar to the --list-different parameter in the CLI and is useful for running Prettier in CI scenarios.

format is used to format text using Prettier. Options may be provided to override the defaults.

formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code. This is useful for editor integrations, to prevent the cursor from moving when code is formatted