{"name":"purdy","version":"0.2.0","description":"print objects real purdy in color","main":"index.js","scripts":{"test":"make test-cov"},"homepage":"https://github.com/danielb2/purdy.js","bugs":{"url":"https://github.com/danielb2/purdy.js/issues"},"repository":{"type":"git","url":"https://github.com/danielb2/purdy.js.git"},"author":{"name":"Daniel Bretoi"},"keywords":["ansi","terminal","colors","pretty","print","color"],"license":"MIT","devDependencies":{"lab":"3.x.x"},"dependencies":{"colors":"0.6.x","hoek":"2.1.x"},"_id":"purdy@0.2.0","dist":{"shasum":"8a92afd92a8ad681daea4006be8d128f258f2fb7","tarball":"http://registry-npm.ywwl.com/purdy/download/purdy-0.2.0.tgz","integrity":"sha512-f7dglXgSsDvOsXGuJq9wiktaovQxWDTU0F94xehO/6mcXc4Db7WOkCOvacHVMm2y+/SMP+WQ4ZOTptWfQUJOzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD49uT3Mt3ILsRiZpAkG/5WCR5+XRZFgcldvN8khBjvTgIgSMi2qkKk8E0Ozcye1fF4qB6qDJNpZk5gruu2GAujzio="}],"size":7619,"noattachment":false,"key":"/purdy/-/purdy-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"danielb","email":"nefar@otherware.org"},"maintainers":[{"name":"danielb","email":"nefar@otherware.org"}],"directories":{},"readme":"# Purdy ![build](https://travis-ci.org/danielb2/purdy.js.svg) ![coverage](https://img.shields.io/badge/coverage-100%25-green.svg)\n\nPrint things real purdy for nodejs.\n\n## Usage\n\n```javascript\n    const Purdy = require('purdy');\n    Purdy({list: [1,2,3], string: 'some string'});\n```\n\n### `Purdy(object, [options])`\n\n![image](https://github.com/danielb2/purdy/raw/master/example.png)\n\nPrints anything indented, and with arrays with index keys, and different\ntypes in colors such that it's very easy to get an overview of what object\nyou're dealing with.\n\n* `object` - anything, number, object, array, etc.\n* `options` - optional object with the following keys.\n    * `plain` - when `true`, prints result without colors. Defaults to `false` with tty, `true` when not.\n    * `path` - when `true`, prints result with a path (To be used with [Hoek.reach()](https://github.com/spumko/hoek#reachobj-chain-options) or lodash.get, etc). Default: `false`\n    * `pathPrefix` - prefix for path. Default: `// `\n    * `arrayIndex` - enables index printing for arrays. Default: `true`\n    * `indent` - defines the number of spaces to indent. Default: `4`\n    * `align` - determines how to align object keys. Default: `left`\n    * `depth` - tells purdy how many times to recurse while formatting the object. This is useful for viewing complicated objects. Default: `2`. Set to `null` to recurse indefinitely\n    * `proto` - include the prototype chain and print all inherited properties as well. Default: `false`\n    * `json` - attempt to parse strings beginning with { as JSON. Default: `false`\n\n\n### `Purdy.stringify(object, [options])`\n\nThis function returns a string without printing it to stdout. This may prove\nto be useful for log files other other applications.\n\n``` javascript\nconst purdyString = Purdy.stringify({a: 'b'}, {plain: true});\nwriteLog(purdyString);\n```\n\n### `Purdy.purdy([options]);`\n\nUseful if you want to print multiple objects like console.log\n\n``` javascript\nconst purdy = Purdy.purdy({plain: true});\npurdy.print('one', 'two');\npurdy.stringify('one', 'two');\n```\n\n### Examples\n\nThe following code prints what's in the image above.\n\n``` javascript\nconst mises = function mises () { this.moop = 3 }\nconst instance = new mises();\nconst circularObj = { };\ncircularObj.a = circularObj;\nconst obj = {\n    integer: Date.now(),\n    string: 'foo',\n    anonPurdy: Purdy,\n    defined: function Yes() {},\n    nested: {hello: 'hapi'},\n    error: new Error('bad'),\n    null: null,\n    undefined: undefined,\n    regexp: new RegExp,\n    falseBool: false,\n    trueBool: true,\n    symbol: Symbol('purdy'),\n    emptyArr: [],\n    circular: circularObj,\n    date: new Date(),\n    arrayWithVisibleIndex: [ 'one', 'two', 'three' ],\n    instance: instance,\n};\nPurdy(obj);\n\n```\n\n\n### Command-line Interface\n\nThis package also installs the `purdy` CLI tool. Right now this just prints\nany JSON file with default options.\n\n`purdy package.json` will, for example, print the JSON contents of\npackage.json.\n\nSimilarly, `cat package.json | purdy -s`  will use stdin to print the contents.\n\nA new option `-l` has been added to parse log files for newline delimited JSON (NDJSON).\n\n`purdy -l logfile.log` will print that or `cat app.log | purdy -l -s`\n\n## Contributing\n\nThis project adheres to the [hapi styleguide](https://github.com/hapijs/contrib/blob/master/Style.md).\n\n## Acknowledgements\n* Michael Dvorkin for [Awesome Print]\n\n[Awesome Print]: https://github.com/michaeldv/awesome_print\n","publish_time":1399437237667,"_cnpm_publish_time":1399437237667,"dist-tags":{"latest":"3.6.0"}}