{"library":"pretty-format2","title":"pretty-format2","description":"pretty-format2 is a JavaScript library for stringifying any value into a human-readable format, designed to be faster and more feature-rich than alternatives like JSON.stringify, pretty-format, and util.inspect. Version 2.0.4 is a work-in-progress with no stable release yet; the package is experimental and subject to breaking changes. Key differentiators include support for plugins, custom indentation, color themes via ANSI escape codes, and a streaming API. It aims to be more performant than pretty-format and more customizable than util.inspect for both Node.js and browser environments.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install pretty-format2"],"cli":null},"imports":["import { prettyFormat } from 'pretty-format2'","import { plugins } from 'pretty-format2'","import type { PrettyFormatOptions } from 'pretty-format2'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { prettyFormat } from 'pretty-format2';\n\nconst obj = {\n  name: 'example',\n  nested: { a: 1, b: 2 },\n  date: new Date('2023-01-01'),\n  regex: /test/gi,\n  fn: function() { return true; },\n  [Symbol('id')]: 42,\n};\n\nconst formatted = prettyFormat(obj, {\n  indent: 2,\n  printFunctionName: true,\n  highlight: true,\n  theme: {\n    key: 'yellow',\n    string: 'green',\n    number: 'blue',\n    boolean: 'magenta',\n    null: 'red',\n    undefined: 'grey',\n  },\n});\n\nconsole.log(formatted);","lang":"typescript","description":"Demonstrates basic usage of prettyFormat with options for indentation, function name printing, color theme, and highlighting.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}