109 releases (65 breaking)

0.67.4 Feb 27, 2025
0.67.2 Oct 14, 2024
0.67.0 Jun 30, 2024
0.66.1 Feb 23, 2024
0.4.0 Nov 4, 2019

#340 in Value formatting

Download history 6982/week @ 2025-12-05 7133/week @ 2025-12-12 4376/week @ 2025-12-19 3112/week @ 2025-12-26 5558/week @ 2026-01-02 7186/week @ 2026-01-09 8163/week @ 2026-01-16 7320/week @ 2026-01-23 10249/week @ 2026-01-30 11504/week @ 2026-02-06 14257/week @ 2026-02-13 14694/week @ 2026-02-20 20338/week @ 2026-02-27 25377/week @ 2026-03-06 20276/week @ 2026-03-13 18593/week @ 2026-03-20

86,753 downloads per month
Used in 71 crates (24 directly)

MIT license

270KB
6.5K SLoC

dprint-core

Rust crate for common dprint code.

Features:

  • formatting - Code to help build a code formatter in Rust (not required for creating a plugin).
  • process - Code to help build a "process plugin"
  • wasm - Code to help build a "wasm plugin" (recommended over process plugins)

Formatting Api

Use:

let result = dprint_core::formatting::format(|| {
    let print_items = ...; // parsed out IR (see example below)
    print_items
}, PrintOptions {
    indent_width: 4,
    max_width: 10,
    use_tabs: false,
    newline_kind: "\n",
});

Example

See overview.md.

Dependencies

~0.9–3.5MB
~59K SLoC