Skip to content
plugin to pretty-print or minify data in XML, JSON and CSS formats
Branch: master
Clone or download

Latest commit

Latest commit 22a34a5 Oct 19, 2017


Type Name Latest commit message Commit time
Failed to load latest commit information.

pretty-data - Nodejs plugin

nodejs plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats.

Version - 0.50.0

Copyright (c) 2012 Vadim Kiryukhin ( vkiryukhin @ )

Home page:

License: Dual licensed under the MIT and GPL licenses:


  • pd.xml(data ) - pretty print XML;

  • pd.json(data) - pretty print JSON;

  • pd.css(data ) - pretty print CSS;

  • pd.sql(data ) - pretty print SQL;

  • pd.xmlmin(data [, preserveComments]) - minify XML;

  • pd.jsonmin(data) - minify JSON text;

  • pd.cssmin(data [, preserveComments] ) - minify CSS text;

  • pd.sqlmin(data) - minify SQL text;


@data - String; XML, JSON, CSS or SQL text to beautify;

@preserveComments - Bool (optional, used in npp.minxml and npp.mincss only); Set this flag to true to prevent removing comments from @data;

@Return - String;


var pd = require('pretty-data').pd;

var xml_pp = pd.xml(data);

var xml_min = pd.xmlmin(data [,true]);

var json_pp = pd.json(data);

var json_min = pd.jsonmin(data);

var css_pp = pd.css(data);

var css_min = pd.cssmin(data [, true]);

var sql_pp = pd.sql(data);

var sql_min = pd.sqlmin(data);

You can’t perform that action at this time.