Skip to main content
Home

Built and signed on GitHub Actions

Dart Formatter powered by WASM ported from dart_style

This package works with Node.js, BrowsersIt is unknown whether this package works with Cloudflare Workers, Deno, 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
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
47%
Published
7 months ago (0.2.0)

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:

Add "@wasm-fmt/dart_fmt" to optimizeDeps.exclude in your vite config:

{
    "optimizeDeps": {
        "exclude": ["@wasm-fmt/dart_fmt"]
    }
}
If you cannot change the vite config, you can use another import entry
import init, { format } from "@wasm-fmt/dart_fmt/vite";

// ...
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fmt/dart-fmt

Import symbol

import * as dart_fmt from "@fmt/dart-fmt";
or

Import directly with a jsr specifier

import * as dart_fmt from "jsr:@fmt/dart-fmt";

Add Package

pnpm i jsr:@fmt/dart-fmt
or (using pnpm 10.8 or older)
pnpm dlx jsr add @fmt/dart-fmt

Import symbol

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

Add Package

yarn add jsr:@fmt/dart-fmt
or (using Yarn 4.8 or older)
yarn dlx jsr add @fmt/dart-fmt

Import symbol

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

Add Package

vlt install jsr:@fmt/dart-fmt

Import symbol

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

Add Package

npx jsr add @fmt/dart-fmt

Import symbol

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

Add Package

bunx jsr add @fmt/dart-fmt

Import symbol

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