104 releases (64 breaking)

0.66.2 May 6, 2024
0.66.1 Feb 23, 2024
0.65.0 Nov 26, 2023
0.63.1 Jul 30, 2023
0.4.0 Nov 4, 2019

#270 in Value formatting

Download history 1420/week @ 2024-01-23 1599/week @ 2024-01-30 1621/week @ 2024-02-06 1504/week @ 2024-02-13 2070/week @ 2024-02-20 2294/week @ 2024-02-27 1819/week @ 2024-03-05 1680/week @ 2024-03-12 1396/week @ 2024-03-19 1732/week @ 2024-03-26 2213/week @ 2024-04-02 2249/week @ 2024-04-09 2511/week @ 2024-04-16 2148/week @ 2024-04-23 2969/week @ 2024-04-30 2969/week @ 2024-05-07

11,056 downloads per month
Used in 35 crates (18 directly)

MIT license

265KB
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.2–9MB
~71K SLoC