107 releases (65 breaking)

0.67.2 Oct 14, 2024
0.67.0 Jun 30, 2024
0.66.1 Feb 23, 2024
0.65.0 Nov 26, 2023
0.4.0 Nov 4, 2019

#866 in WebAssembly

Download history 3797/week @ 2024-07-15 3136/week @ 2024-07-22 2048/week @ 2024-07-29 2085/week @ 2024-08-05 2024/week @ 2024-08-12 1952/week @ 2024-08-19 2213/week @ 2024-08-26 2091/week @ 2024-09-02 2286/week @ 2024-09-09 2070/week @ 2024-09-16 3021/week @ 2024-09-23 2502/week @ 2024-09-30 3324/week @ 2024-10-07 3101/week @ 2024-10-14 3110/week @ 2024-10-21 3080/week @ 2024-10-28

12,700 downloads per month
Used in 44 crates (20 directly)

MIT license

270KB
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–8.5MB
~76K SLoC