49 releases (breaking)

new 0.35.2 Mar 6, 2021
0.34.0 Dec 27, 2020
0.33.1 Nov 30, 2020
0.25.0 Jul 27, 2020
0.4.0 Nov 4, 2019

#47 in Value formatting

Download history 2436/week @ 2020-11-15 3751/week @ 2020-11-22 3389/week @ 2020-11-29 4090/week @ 2020-12-06 4437/week @ 2020-12-13 2204/week @ 2020-12-20 2558/week @ 2020-12-27 4575/week @ 2021-01-03 3784/week @ 2021-01-10 3863/week @ 2021-01-17 4293/week @ 2021-01-24 2719/week @ 2021-01-31 3226/week @ 2021-02-07 4149/week @ 2021-02-14 2894/week @ 2021-02-21 1910/week @ 2021-02-28

14,755 downloads per month
Used in 9 crates (5 directly)

MIT license

175KB
4K 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.5–1.5MB
~35K SLoC