103 releases (64 breaking)

0.66.1 Feb 23, 2024
0.65.0 Nov 26, 2023
0.63.1 Jul 30, 2023
0.61.0 Mar 13, 2023
0.4.0 Nov 4, 2019

#662 in WebAssembly

Download history 791/week @ 2023-12-23 1161/week @ 2023-12-30 1441/week @ 2024-01-06 1493/week @ 2024-01-13 1407/week @ 2024-01-20 1593/week @ 2024-01-27 1592/week @ 2024-02-03 1460/week @ 2024-02-10 1845/week @ 2024-02-17 1993/week @ 2024-02-24 2311/week @ 2024-03-02 1718/week @ 2024-03-09 1356/week @ 2024-03-16 1455/week @ 2024-03-23 2374/week @ 2024-03-30 1696/week @ 2024-04-06

7,092 downloads per month
Used in 35 crates (18 directly)

MIT license

265KB
6.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)

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.2–10MB
~72K SLoC