Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
testdata
vendor Rename assertEq to assertEquals (#242) Mar 7, 2019
README.md
main.ts Add prettier styling options (#281) Mar 17, 2019
main_test.ts
prettier.ts
test.ts Test reorganization (#290) Mar 18, 2019
util.ts

README.md

prettier

Prettier APIs and tools for deno

Use as a CLI

To formats the source files, run:

deno --allow-read --allow-write https://deno.land/std/prettier/main.ts

You can format only specific files by passing the arguments.

deno --allow-read --allow-write https://deno.land/std/prettier/main.ts path/to/script.ts

You can format files on specific directory by passing the directory's path.

deno --allow-read --allow-write https://deno.land/std/prettier/main.ts path/to/script.ts

Use API

You can use APIs of prettier as the following:

import {
  prettier,
  prettierPlugins
} from "https://deno.land/std/prettier/prettier.ts";

prettier.format("const x = 1", {
  parser: "babel",
  plugins: prettierPlugins
}); // => "const x = 1;"
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.