58 releases (breaking)

new 0.43.0 Jun 13, 2021
0.41.0 May 23, 2021
0.35.3 Mar 21, 2021
0.34.0 Dec 27, 2020
0.4.0 Nov 4, 2019

#45 in Value formatting

Download history 2422/week @ 2021-02-24 1268/week @ 2021-03-03 1240/week @ 2021-03-10 1456/week @ 2021-03-17 3667/week @ 2021-03-24 4347/week @ 2021-03-31 3747/week @ 2021-04-07 2252/week @ 2021-04-14 3540/week @ 2021-04-21 2327/week @ 2021-04-28 2803/week @ 2021-05-05 2305/week @ 2021-05-12 1529/week @ 2021-05-19 1270/week @ 2021-05-26 2543/week @ 2021-06-02 1422/week @ 2021-06-09

10,953 downloads per month
Used in 13 crates (6 directly)

MIT license

190KB
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.6MB
~38K SLoC