#debug #pretty #javascript


Pretty-printer for JS values from wasm-bindgen

3 unstable releases

0.2.1 Oct 18, 2020
0.2.0 Aug 24, 2020
0.1.0 Aug 21, 2020

#153 in Value formatting


315 lines


prettiest provides pretty-printing Debug and Display impls for Javascript values in the wasm-bindgen crate.

[0.2.1] - 2020-10-18

  • Output should be (more) stable across browser versions.


  • Prettified sorts object properties for each prototype before printing.
  • Prettified prints functions for each prototype after the properties from that prototype and before the properties of the preceding prototype.

[0.2.0] - 2020-08-22


  • Pretty trait offers a .pretty() method to anything AsRef<JsValue>.
  • Prettified implements Display.
  • Prettified::skip_property allows deleting properties that aren't useful to print, like timeStamp.


  • Cycles in objects are broken correctly.
  • Null and undefined values are handled correctly.
  • Values not explicitly handled are represented by Pretty::Unknown.
  • Objects print properties from their prototype chain.


  • Pretty enum renamed to Prettified to allow trait to be named Pretty.
  • Objects print non-function properties before function properties.
  • Objects print their properites in prototype-order.
  • HTML elements, window and document all have abbreviated output.

[0.1.0] - 2020-08-20

Initial release. Only sort of works -- not recommended for use.


~170K SLoC