A Node.js plugin for pretty-printing and minifying XML, JSON, CSS, and SQL text, with a stable version 0.40.1 and infrequent updates. Provides functions like pd.xml(), pd.json(), pd.css(), pd.sql() for beautification and corresponding *min variants for minification, with optional comment preservation for XML and CSS. Lightweight with no dependencies, suitable for formatting data on the server or in build tools. Differentiates from alternatives like js-beautify or prettier by focusing solely on these four formats and offering separate minification methods.
npm install pretty-data2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates pretty-printing JSON, XML, SQL, and minifying CSS using pretty-data2 with ESM imports.
Use named import: import { pd } from 'pretty-data2'; or CommonJS: const pd = require('pretty-data2').pd;Call pd.xmlmin(data, true) to preserve comments, pd.xmlmin(data) to remove them.
Ensure correct import: import { pd } from 'pretty-data2'.Replace 'pretty-data' with 'pretty-data2' in your dependencies.
Use import { pd } from 'pretty-data2' or const pd = require('pretty-data2').pd;Run: npm install pretty-data2
Validate input data before processing with pd.json() or pd.jsonmin().
No dependency data recorded yet.