107 releases (65 breaking)

0.67.2 Oct 14, 2024
0.67.0 Jun 30, 2024
0.66.1 Feb 23, 2024
0.65.0 Nov 26, 2023
0.4.0 Nov 4, 2019

#941 in WebAssembly

Download history 2644/week @ 2024-09-27 3064/week @ 2024-10-04 3234/week @ 2024-10-11 3056/week @ 2024-10-18 3127/week @ 2024-10-25 3135/week @ 2024-11-01 2843/week @ 2024-11-08 2447/week @ 2024-11-15 2515/week @ 2024-11-22 3002/week @ 2024-11-29 3366/week @ 2024-12-06 2923/week @ 2024-12-13 2156/week @ 2024-12-20 1912/week @ 2024-12-27 3348/week @ 2025-01-03 3414/week @ 2025-01-10

11,292 downloads per month
Used in 50 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–9MB
~75K SLoC