Comparing version 1.4.1 to 1.5.0
{ | ||
"name": "purdy", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "pretty print objects in real purdy colors. Allows clearer visualization of objects than you get from most pretty printers due to colors. It will also print out the complete path to an object, something that's extremly useful for debugging. Purdy will also print out the path to access a variable using Hoek format making it useful on accessing values.", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "make test-cov" | ||
"test": "lab -a code -t 98 -r html -o coverage.html -r console -o stdout -v" | ||
}, | ||
@@ -25,4 +25,8 @@ "homepage": "https://github.com/danielb2/purdy.js", | ||
"license": "MIT", | ||
"bin": { | ||
"purdy": "bin/purdy.js" | ||
}, | ||
"devDependencies": { | ||
"lab": "4.x.x" | ||
"code": "1.x.x", | ||
"lab": "5.x.x" | ||
}, | ||
@@ -29,0 +33,0 @@ "dependencies": { |
@@ -1,2 +0,2 @@ | ||
# Purdy | ||
# Purdy ![build](https://travis-ci.org/danielb2/purdy.js.svg) | ||
@@ -102,4 +102,13 @@ Print things real purdy for nodejs. | ||
### Command-line Interface | ||
This package also installs the `purdy` CLI tool. Right now this just prints | ||
any JSON file with default options. | ||
`purdy package.json` will, for example, print the JSON contents of | ||
package.json. | ||
Similarly, `cat package.json | purdy -` will use stdin to print the contents. | ||
## Acknowledgements | ||
@@ -106,0 +115,0 @@ * Michael Dvorkin for [Awesome Print] |
@@ -0,1 +1,2 @@ | ||
var Code = require('code'); | ||
var Hoek = require('hoek'); | ||
@@ -5,9 +6,10 @@ var Lab = require('lab'); | ||
// Test shortcuts | ||
var lab = exports.lab = Lab.script(); | ||
var expect = Lab.expect; | ||
var describe = lab.describe; | ||
var it = lab.it; | ||
var expect = Code.expect; | ||
var before = lab.before; | ||
var after = lab.after; | ||
@@ -66,2 +68,3 @@ | ||
it('should handle circular references', function (done) { | ||
var circularObj = { }; | ||
@@ -224,7 +227,7 @@ circularObj.a = circularObj; | ||
var obj = { | ||
var obj = { | ||
a: 2323 | ||
}; | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true }) | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true }); | ||
expect(out).to.equal('{\n a: 2323\n}'); | ||
@@ -240,8 +243,8 @@ done(); | ||
b: 1, | ||
c: 1, | ||
c: 1 | ||
}; | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true, align: 'left' }) | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true, align: 'left' }); | ||
expect(out).to.equal('{\n longthing: 3,\n a: 1,\n b: 1,\n c: 1\n}'); | ||
out = Purdy.stringify(obj, { arrayIndex: false, plain: true, align: 'right' }) | ||
out = Purdy.stringify(obj, { arrayIndex: false, plain: true, align: 'right' }); | ||
expect(out).to.equal('{\n longthing: 3,\n a: 1,\n b: 1,\n c: 1\n}'); | ||
@@ -256,2 +259,3 @@ done(); | ||
process.stdout.write = function (str) { | ||
out += str; | ||
@@ -269,3 +273,3 @@ }; | ||
var obj = { | ||
var obj = { | ||
a: 2323 | ||
@@ -276,3 +280,3 @@ }; | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true }) | ||
var out = Purdy.stringify(obj, { arrayIndex: false, plain: true }); | ||
expect(out).to.equal('{\n a: 2323,\n Symbol(): \'symbol\'\n}'); | ||
@@ -279,0 +283,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131122
443
117
2
1