Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pretty-print

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-print - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

16

index.js
var _ = require('lodash');
var feedback = require('feedback');
var chalk = require('chalk');
var util = require('util');

@@ -37,3 +38,16 @@ var print = module.exports = function (data, options) {

feedback.info(lPad + paddedKey + JSON.stringify(data[key]).replace(/^\"|\"$/g, ''));
if (util.isArray(data[key])){
var blankKey = key.replace(/./gi, ' '); // used for spacing
var blankPaddedKey = addPadding(blankKey, maxKeyLen);
var arr = data[key];
feedback.info(lPad + paddedKey + JSON.stringify(arr[0]).replace(/^\"|\"$/g, ''));
for(var i = 1; i < arr.length; i += 1) {
feedback.info(lPad + blankPaddedKey + JSON.stringify(arr[i]).replace(/^\"|\"$/g, ''));
}
}
else{
feedback.info(lPad + paddedKey + JSON.stringify(data[key]).replace(/^\"|\"$/g, ''));
}
});

@@ -40,0 +54,0 @@ }

2

package.json
{
"name": "pretty-print",
"version": "0.3.0",
"version": "0.3.1",
"description": "Print formatted data to the the command line",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -20,4 +20,12 @@ var print = require('../');

var data = ['name1', 'name2'];
// var data = ['name1', 'name2'];
data = {
name: 'Scott',
age: 30,
emails: ['scottcorgan@gmail.com', 'scott@divshot.com', 'scott@lakeshorecitychurch.com'],
wife: 'Lindsay'
}
print(data, {

@@ -24,0 +32,0 @@ // padding: 3,

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