94 releases (60 breaking)

new 0.62.0 Jun 3, 2023
0.61.0 Mar 13, 2023
0.60.0 Dec 7, 2022
0.59.1 Nov 20, 2022
0.4.0 Nov 4, 2019

#388 in Web programming

Download history 2273/week @ 2023-02-11 2304/week @ 2023-02-18 2276/week @ 2023-02-25 1954/week @ 2023-03-04 2172/week @ 2023-03-11 1791/week @ 2023-03-18 1627/week @ 2023-03-25 1768/week @ 2023-04-01 2013/week @ 2023-04-08 2020/week @ 2023-04-15 1913/week @ 2023-04-22 2101/week @ 2023-04-29 2107/week @ 2023-05-06 1788/week @ 2023-05-13 1849/week @ 2023-05-20 1459/week @ 2023-05-27

7,470 downloads per month
Used in 29 crates (14 directly)

MIT license

240KB
6K 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–7MB
~115K SLoC