63 releases (breaking)

0.46.2 Sep 13, 2021
0.45.0 Aug 28, 2021
0.43.0 Jun 13, 2021
0.35.3 Mar 21, 2021
0.4.0 Nov 4, 2019

#43 in Value formatting

Download history 2567/week @ 2021-06-01 1609/week @ 2021-06-08 2004/week @ 2021-06-15 2293/week @ 2021-06-22 2892/week @ 2021-06-29 2736/week @ 2021-07-06 2220/week @ 2021-07-13 2007/week @ 2021-07-20 1641/week @ 2021-07-27 2047/week @ 2021-08-03 2680/week @ 2021-08-10 2319/week @ 2021-08-17 2609/week @ 2021-08-24 2898/week @ 2021-08-31 2699/week @ 2021-09-07 2913/week @ 2021-09-14

10,232 downloads per month
Used in 17 crates (8 directly)

MIT license

175KB
4.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)

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.6–1.4MB
~32K SLoC