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

#1399 in WebAssembly

Download history 2408/week @ 2024-11-19 2829/week @ 2024-11-26 3203/week @ 2024-12-03 3372/week @ 2024-12-10 2747/week @ 2024-12-17 1747/week @ 2024-12-24 2499/week @ 2024-12-31 3669/week @ 2025-01-07 4262/week @ 2025-01-14 3965/week @ 2025-01-21 4367/week @ 2025-01-28 4747/week @ 2025-02-04 3546/week @ 2025-02-11 3832/week @ 2025-02-18 2813/week @ 2025-02-25 2127/week @ 2025-03-04

13,043 downloads per month
Used in 52 crates (20 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

~1.1–8.5MB
~73K SLoC