Socket
Socket
Sign inDemoInstall

pretty-data

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-data

plugin to pretty print or minify XML, JSON, CSS and SQL files


Version published
Weekly downloads
232K
decreased by-18.16%
Maintainers
1
Weekly downloads
 
Created

What is pretty-data?

The pretty-data npm package is a utility for formatting and minifying JSON, XML, and CSS data. It helps in making data more readable or compact, depending on the need.

What are pretty-data's main functionalities?

JSON Pretty Print

This feature formats JSON data to be more readable by adding indentation and line breaks.

const pd = require('pretty-data').pd;
const json = '{"name":"John","age":30,"city":"New York"}';
console.log(pd.json(json));

JSON Minify

This feature minifies JSON data by removing unnecessary whitespace, making it more compact.

const pd = require('pretty-data').pd;
const json = '{"name":"John","age":30,"city":"New York"}';
console.log(pd.jsonmin(json));

XML Pretty Print

This feature formats XML data to be more readable by adding indentation and line breaks.

const pd = require('pretty-data').pd;
const xml = '<root><name>John</name><age>30</age><city>New York</city></root>';
console.log(pd.xml(xml));

XML Minify

This feature minifies XML data by removing unnecessary whitespace, making it more compact.

const pd = require('pretty-data').pd;
const xml = '<root><name>John</name><age>30</age><city>New York</city></root>';
console.log(pd.xmlmin(xml));

CSS Pretty Print

This feature formats CSS data to be more readable by adding indentation and line breaks.

const pd = require('pretty-data').pd;
const css = 'body{margin:0;padding:0;}h1{color:red;}';
console.log(pd.css(css));

CSS Minify

This feature minifies CSS data by removing unnecessary whitespace, making it more compact.

const pd = require('pretty-data').pd;
const css = 'body{margin:0;padding:0;}h1{color:red;}';
console.log(pd.cssmin(css));

Other packages similar to pretty-data

Keywords

FAQs

Package last updated on 06 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc