Skip to main content

Dart Formatter powered by WASM ported from dart_style

Works with
It is unknown whether this package works with Bun
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Browsers
JSR Score
47%
Published
5 days ago

Test

Install

npm

npm install @wasm-fmt/dart_fmt

jsr.io

npx jsr add @fmt/dart-fmt

Usage

import init, { format } from "@wasm-fmt/dart_fmt";

await init();

const input = `void main() { print('Hello, World!'); }`;

const formatted = format(input, "main.dart");
console.log(formatted);

For Vite users:

import init, { format } from "@wasm-fmt/dart_fmt/vite";

// ...
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @fmt/dart-fmt

Import symbol

import * as mod from "@fmt/dart-fmt";

Add Package

npx jsr add @fmt/dart-fmt

Import symbol

import * as mod from "@fmt/dart-fmt";

Add Package

yarn dlx jsr add @fmt/dart-fmt

Import symbol

import * as mod from "@fmt/dart-fmt";

Add Package

pnpm dlx jsr add @fmt/dart-fmt

Import symbol

import * as mod from "@fmt/dart-fmt";

Add Package

bunx jsr add @fmt/dart-fmt

Import symbol

import * as mod from "@fmt/dart-fmt";