45 releases (breaking)

new 0.33.1 Nov 30, 2020
0.32.0 Nov 23, 2020
0.25.0 Jul 27, 2020
0.12.0 Mar 23, 2020
0.4.0 Nov 4, 2019

#7 in Value formatting

Download history 1182/week @ 2020-08-10 1432/week @ 2020-08-17 1343/week @ 2020-08-24 1357/week @ 2020-08-31 1211/week @ 2020-09-07 581/week @ 2020-09-14 542/week @ 2020-09-21 900/week @ 2020-09-28 1205/week @ 2020-10-05 1107/week @ 2020-10-12 3310/week @ 2020-10-19 2998/week @ 2020-10-26 2641/week @ 2020-11-02 3398/week @ 2020-11-09 2600/week @ 2020-11-16 3379/week @ 2020-11-23

8,435 downloads per month
Used in 11 crates (4 directly)

MIT license

170KB
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 print_items = ...; // parsed out IR (see example below)
let result = dprint_core::formatting::print(print_items, PrintOptions {
    indent_width: 4,
    max_width: 10,
    use_tabs: false,
    newline_kind: "\n",
});

Example

See overview.md.

Dependencies

~0.6–1.7MB
~39K SLoC