{"_id":"prettyoutput","_rev":"8-d8983663be9ce4a763868acf4562f647","name":"prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"author":{"name":"Nadim","email":"nadim.boustani@gmail.com","url":"https://github.com/bnadim"},"name":"prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.0.0","homepage":"http://github.com/keepitcool/prettyoutput","keywords":["json","js","log","cli","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/keepitcool/prettyoutput.git"},"bugs":{"url":"https://github.com/keepitcool/prettyoutput/issues"},"main":"./lib/prettyoutput","license":"MIT","scripts":{"test":"mocha --reporter spec","eslint":"eslint . bin/prettyoutput","coverage":"nyc npm run test","codecov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec","benchmark":"node ./benchmark/benchmark.js","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},"bin":{"prettyoutput":"./bin/prettyoutput"},"dependencies":{"colors":"1.1.2","commander":"2.9.0","lodash":"4.16.6"},"devDependencies":{"columnify":"1.5.4","eslint":"3.9.1","istanbul":"0.4.5","mocha":"3.1.2","nyc":"8.4.0","prettyjson":"1.1.3","should":"11.1.1"},"gitHead":"df2548c1069c5248aa99f49d7a9fbc1a1f0c35ac","_id":"prettyoutput@1.0.0","_shasum":"8607fa3fe6154f03ff74829f045c361d370aa5fc","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.0","_npmUser":{"name":"keepitcool","email":"keepitcoolit@gmail.com"},"dist":{"shasum":"8607fa3fe6154f03ff74829f045c361d370aa5fc","tarball":"https://registry.npmjs.org/prettyoutput/-/prettyoutput-1.0.0.tgz","integrity":"sha512-AitOjQTOd/XerQbWG/V8cXkZ8Gc2FB0KzvT8/5BDN/7eE4WtGzrPY6+VyA3ejwk3aletkKpOyfHfS1l+GgsmWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzbEyhBf5+hb7w28Lr5bchLgWYHqxiFRWQuYy9gVMieQIgN3hg31KdYc6ndiEmGtS4wsMTzCPjCZoZCRQcrCGmf4U="}]},"maintainers":[{"name":"keepitcool","email":"keepitcoolit@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/prettyoutput-1.0.0.tgz_1478817348118_0.4404528266750276"},"directories":{}},"1.1.0":{"author":{"name":"Nadim","email":"nadim.boustani@gmail.com","url":"https://github.com/bnadim"},"name":"prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.1.0","homepage":"http://github.com/keepitcool/prettyoutput","keywords":["json","js","log","cli","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/keepitcool/prettyoutput.git"},"bugs":{"url":"https://github.com/keepitcool/prettyoutput/issues"},"main":"./lib/prettyoutput","license":"MIT","scripts":{"test":"mocha --reporter spec","eslint":"eslint . bin/prettyoutput","coverage":"nyc npm run test","codecov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec","benchmark":"node ./benchmark/benchmark.js","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},"bin":{"prettyoutput":"./bin/prettyoutput"},"dependencies":{"colors":"1.1.2","commander":"2.9.0","lodash":"4.16.6"},"devDependencies":{"columnify":"1.5.4","eslint":"3.9.1","istanbul":"0.4.5","mocha":"3.1.2","nyc":"8.4.0","prettyjson":"1.1.3","should":"11.1.1"},"gitHead":"e81dd18500b301a4d39810fb3c9f70a86ed260e1","_id":"prettyoutput@1.1.0","_shasum":"32932f661c327cf2552f17dcea1e0cee8283fcdc","_from":".","_npmVersion":"4.0.3","_nodeVersion":"7.2.0","_npmUser":{"name":"keepitcool","email":"keepitcoolit@gmail.com"},"dist":{"shasum":"32932f661c327cf2552f17dcea1e0cee8283fcdc","tarball":"https://registry.npmjs.org/prettyoutput/-/prettyoutput-1.1.0.tgz","integrity":"sha512-xwcI/wBo6rAeiFDZyINcVwH/Ow7KWnL3JWcyCBpFHwyEMFkqtry/ap49zkR4n4OclcfVr2162anWfyRuQnk5oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP1a+zq5VPtomw8upjlJzTLKEn8Hn+Lf5Hdz+UrLx7VQIhAOBvm5F/IBFepZbOcXsYnu0cQjOZ91iSB1xKjAqp5VNi"}]},"maintainers":[{"name":"keepitcool","email":"keepitcoolit@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/prettyoutput-1.1.0.tgz_1480271649425_0.20085984957404435"},"directories":{}},"1.1.1":{"author":{"name":"Nadim","email":"nadim.boustani@gmail.com","url":"https://github.com/bnadim"},"name":"prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.1.1","homepage":"http://github.com/keepitcool/prettyoutput","keywords":["json","js","log","cli","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/keepitcool/prettyoutput.git"},"bugs":{"url":"https://github.com/keepitcool/prettyoutput/issues"},"main":"./lib/prettyoutput","license":"MIT","scripts":{"test":"mocha --reporter spec","eslint":"eslint . bin/prettyoutput","coverage":"nyc npm run test","codecov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec","benchmark":"node ./benchmark/benchmark.js","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},"bin":{"prettyoutput":"./bin/prettyoutput"},"dependencies":{"colors":"1.1.2","commander":"2.9.0","lodash":"4.16.6"},"devDependencies":{"columnify":"1.5.4","eslint":"3.9.1","istanbul":"0.4.5","mocha":"3.1.2","nyc":"8.4.0","prettyjson":"1.1.3","should":"11.1.1"},"gitHead":"3cf8b1620bfd57d2df5a60c037e9b22d66795fe7","_id":"prettyoutput@1.1.1","_shasum":"81f738733fc9a20a4ac9364802edf5cb66f3f742","_from":".","_npmVersion":"4.0.3","_nodeVersion":"7.2.0","_npmUser":{"name":"keepitcool","email":"keepitcoolit@gmail.com"},"dist":{"shasum":"81f738733fc9a20a4ac9364802edf5cb66f3f742","tarball":"https://registry.npmjs.org/prettyoutput/-/prettyoutput-1.1.1.tgz","integrity":"sha512-KInuu5aV3D7e/8s0eVkKIH2BPvQEnZdzoFMjpBlBJIFFIYdcqoa6aGv72VMvpFHvZ/Jj+ESk6ES4q0mpGMw2lQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/SoI1nKCLZpBjXTtjBEz/KbKwiLGF9E9+ODynJcn8OwIgTtayvmTC2zrA3YCnG8Jkl9b2fAi5q3M1dD+1uEQwBiM="}]},"maintainers":[{"name":"keepitcool","email":"keepitcoolit@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/prettyoutput-1.1.1.tgz_1482959834777_0.2523428346030414"},"directories":{}},"1.2.0":{"author":{"name":"Nadim","email":"nadim.boustani@gmail.com","url":"https://github.com/bnadim"},"name":"prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.2.0","homepage":"http://github.com/keepitcool/prettyoutput","keywords":["json","js","log","cli","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"https://github.com/keepitcool/prettyoutput.git"},"bugs":{"url":"https://github.com/keepitcool/prettyoutput/issues"},"main":"./lib/prettyoutput","license":"MIT","scripts":{"fmt":"prettier --print-width 140 --tab-width=4 --single-quote --bracket-spacing --no-semi --color --write \"{.,{test,lib,benchmark}/**/}/*.js\"","check-fmt":"prettier --print-width 140 --tab-width=4 --single-quote --bracket-spacing --no-semi --list-different \"{.,{test,lib,benchmark}/**/}/*.js\"","test":"./node_modules/.bin/mocha --reporter spec","eslint":"./node_modules/.bin/eslint . bin/prettyoutput","coverage":"nyc npm run test","codecov":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec","benchmark":"node ./benchmark/benchmark.js","changelog":"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},"bin":{"prettyoutput":"./bin/prettyoutput"},"dependencies":{"colors":"1.3.x","commander":"2.19.x","lodash":"4.17.x"},"devDependencies":{"columnify":"1.x.x","eslint":"5.x.x","istanbul":"0.4.5","mocha":"5.x.x","nyc":"13.x.x","prettier":"^1.15.3","prettyjson":"1.x.x","should":"13.x.x"},"licenseText":"MIT License\n\nCopyright (c) 2016 keepitcool\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"prettyoutput@1.2.0","dist":{"shasum":"fef93f2a79c032880cddfb84308e2137e3674b22","integrity":"sha512-G2gJwLzLcYS+2m6bTAe+CcDpwak9YpcvpScI0tE4WYb2O3lEZD/YywkMNpGqsSx5wttGvh2UXaKROTKKCyM2dw==","tarball":"https://registry.npmjs.org/prettyoutput/-/prettyoutput-1.2.0.tgz","fileCount":30,"unpackedSize":2034595,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNzHFCRA9TVsSAnZWagAAXC0P/i1quAn/tR50BkNePjE1\nvoYcqhi+TS77y3kXnizlBDlyL2U/XsmbiSR0fBE8OcKmmBcHmHxp+HXMR8bI\nWxOFpMRiAwvhuU0aon+N29yDZVKRUDFmLH8d25WQw0c/0vSy9SqTMpAHJjTI\n7Hj3zRPsCeAbIw7cnMKnJTb2+YoEwBQoVA2/Otg8OysRi17WTiDfspTWBm5c\nvNv5/W8/oCvjdYiQouEaQdh7XxPa3UjulOptNBeTTgC37J9+emok1JT092C5\ncoq95EA0qwjSQV28bcv0Vqrvhg5Fw68dWZ9EH6W0FEo2osnS3LCNq0DVwq56\nkXk4EwWzvkukjdxCK7ce8S4j1pXOX5s+GORFHKkr3LrvJiG85KUgbwGc4tBA\nMicGQAQ6O9d6c0JuNQOcFkKR8Hfx7WfyFbXr4wc5+aTotferTOlg5zjpBw9w\ngE50hVyOtSJRUxtRwzZRmdaF9zY7DpwGsYiaBsQ4Z/mm13LFFO2kUktq5EC3\nVWlNypUiaAR1L72Fc5B9otm5SSyO+ayJ4Z9InQKNADFO5Mlg7y1v7s1HiWBC\nVfub28kLdvvmt0B5Ugc9EJW5qdJ2dx14JQLA8fr8BjZLraZ6E5l4DpWvpR2d\nVV3V/r2wVjShxAt2Ocof8s/bR510KhQRlhZL7qSTWr6PWJieafoj7ux4SUho\nqlRO\r\n=uRUp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGSGoY/6Q2L5rsNRY2yBcNJJte63EZxdNbdckWNq4xZAiEApytugxiBdrITizlFdARtyncdEVv7amaYu36/4vjjGEk="}]},"maintainers":[{"name":"keepitcool","email":"keepitcoolit@gmail.com"}],"_npmUser":{"name":"keepitcool","email":"keepitcoolit@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prettyoutput_1.2.0_1547121093025_0.6246643373681362"},"_hasShrinkwrap":false}},"readme":"# prettyoutput [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][coveralls-image]][coveralls-url]\n\nLibrary to format js/json object into YAML style readable output.\nIt's performance centric to be used as a logger formatter.\nIt's currently 3 to 5 times quicker than util.inspect used by many loggers.\nIt's available as a NodeJS library or a cli too.\n\n## Credits\nThis is based on the great work done on the project [prettyjson](https://github.com/rafeca/prettyjson)\n\n## How to install\n\nVia NPM:\n\n```bash\n$ npm install prettyoutput\n```\n\n## Using it\n\nIt's pretty easy to use. Just have include it in your script and call it:\n\n```javascript\nconst prettyoutput = require('prettyoutput')\n\nconst data = {\n  username: 'kic',\n  url: 'https://github.com/keepitcool',\n  projects: ['prettyoutput', '3m2tuio']\n}\n\nconsole.log(prettyoutput(data))\n```\n\nOutput:\n\n![Example](docs/images/example.png)\n\n### API\n\n```javascript\nconst prettyoutput = require('prettyoutput')\nprettyoutput(data, options, indent)\n```\n\nParameters are :\n * {*} data            : js or json object\n * {Object} [options]  : Optional. See options below\n * {number} [indent]   : Optional. Indent all output\n\nOptions are :\n * {number} [indentationLength]  : Length of indentation (in terms of space)\n * {number} [maxDepth]           : maximum sublevel of nested objects/arrays to output. Default: 3\n * {boolean} [noColor]           : disable colors. Default: false\n * {colors} [colors]             : Output colors. See below\n * {boolean} [alignKeyValues]    : Align key values. Default: true\n\nColors are :\n * {string} [keys]       : Objects keys color. Default: green\n * {string} [dash]       : Array prefixing dash (\"- \"). Default: green\n * {string} [number]     : Numbers color. Default: blue\n * {string} [string]     : Strings color. Default: no color\n * {string} [true]       : Boolean value 'true' color. Default: green\n * {string} [false]      : Boolean value 'false' color. Default: red\n * {string} [null]       : 'Null' color. Default: grey\n * {string} [undefined]  : 'Undefined' color. Default: grey\n\nExample using options :\n```javascript\nconst prettyoutput = require('prettyoutput')\n\nconst data = {\n  username: 'kic',\n  url: 'https://github.com/keepitcool',\n  projects: ['prettyoutput', '3m2tuio']\n}\n\nconst colors = {\n  keys: 'blue',\n  'null': 'red'\n}\n\nconst options = {\n  noColor: true,\n  maxDepth: 5,\n  colors: colors\n};\n\nconsole.log(prettyoutput(data, options, 2);\n```\n\n## Cli usage\n\nCommand line tool support file param or stdin.\n\nUsage:\n```bash\n$ prettyoutput package.json\n```\n\nThis should output :\n![Example](docs/images/example_cli.png)\n\n### Command line options\n\nIt's possible to customize the output through some command line options:\n\n```bash\n# Indent 4, max depth 5, disable colors\n$ prettyjson --indent=4 --depth=5 --noColor package.json\n```\n\nor\n\n```bash\n# Indent 4, max depth 5, disable colors\n$ cat package.json | prettyjson --indent=4 --depth=5 --noColor\n```\n\n## Benchmark\nProject target logging, so performance is an issue.\nCurrently, prettyoutput is 3 times quicker than util.inspect and 2.5 times quicker than prettyjson, the library it's inspired from.\n\nTo run benchmark, just run :\n```bash\n$ node benchmark/benchmark.js\n```\n\nResults :\n```\nLEVELS | KEYS | LOOPS | WEIGTHS\n3      | 20   | 100   | serializable: 0.9    array: 0.3    object: 0.5    multilineString: 0.3    error: 0.2\n\nNAME         | MIN                 | MAX                 | MEAN                | TOTAL\nprettyoutput | 3 ms 133 µs 526 ns  | 42 ms 563 µs 146 ns | 4 ms 365 µs 617 ns  | 436 ms 561 µs 716 ns\nprettyjson   | 9 ms 615 µs 703 ns  | 21 ms 441 µs 595 ns | 11 ms 447 µs 83 ns  | 1 s 144 ms 708 µs 348 ns\nutil.inspect | 10 ms 839 µs 974 ns | 24 ms 332 µs 545 ns | 12 ms 526 µs 168 ns | 1 s 252 ms 616 µs 884 ns\n\n\nLEVELS | KEYS | LOOPS | WEIGTHS\n4      | 20   | 100   | serializable: 0.9    array: 0.3    object: 0.5    multilineString: 0.3    error: 0.2\n\nNAME         | MIN                 | MAX                  | MEAN                 | TOTAL\nprettyoutput | 29 ms 966 µs 837 ns | 102 ms 170 µs 779 ns | 39 ms 502 µs 799 ns  | 3 s 950 ms 279 µs 972 ns\nprettyjson   | 86 ms 731 µs 622 ns | 159 ms 166 µs 633 ns | 107 ms 813 µs 674 ns | 10 s 781 ms 367 µs 439 ns\nutil.inspect | 90 ms 942 µs 290 ns | 256 ms 995 µs 418 ns | 118 ms 794 µs 343 ns | 11 s 879 ms 434 µs 322 ns\n\n\nLEVELS | KEYS | LOOPS | WEIGTHS\n5      | 20   | 100   | serializable: 0.9    array: 0.3    object: 0.5    multilineString: 0.3    error: 0.2\n\nNAME         | MIN                      | MAX                      | MEAN                     | TOTAL\nprettyoutput | 616 ms 495 µs 243 ns     | 1 s 602 ms 965 µs 211 ns | 768 ms 761 µs 315 ns     | 76 s 876 ms 131 µs 544 ns\nprettyjson   | 1 s 294 ms 734 µs 939 ns | 1 s 686 ms 600 µs 593 ns | 1 s 490 ms 394 µs 707 ns | 149 s 39 ms 470 µs 777 ns\nutil.inspect | 1 s 623 ms 160 µs 631 ns | 2 s 460 ms 983 µs 994 ns | 1 s 731 ms 699 µs 847 ns | 173 s 169 ms 984 µs 758 ns\n\n```\n\n## Running Tests\n\nTo run the test suite first invoke the following command within the repo,\ninstalling the development dependencies:\n\n```bash\n$ npm install\n```\n\nthen run the tests:\n\n```bash\n$ npm test\n```\n\n[npm-image]: https://img.shields.io/npm/v/prettyoutput.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/prettyoutput\n[travis-image]: https://img.shields.io/travis/keepitcool/prettyoutput/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/keepitcool/prettyoutput\n[coveralls-image]: https://img.shields.io/codecov/c/github/keepitcool/prettyoutput.svg?style=flat-square\n[coveralls-url]: https://codecov.io/github/keepitcool/prettyoutput?branch=master\n","maintainers":[{"name":"keepitcool","email":"keepitcoolit@gmail.com"}],"time":{"modified":"2022-06-24T15:06:07.951Z","created":"2016-11-10T22:35:48.718Z","1.0.0":"2016-11-10T22:35:48.718Z","1.1.0":"2016-11-27T18:34:12.469Z","1.1.1":"2016-12-28T21:17:15.416Z","1.2.0":"2019-01-10T11:51:33.322Z"},"homepage":"http://github.com/keepitcool/prettyoutput","keywords":["json","js","log","cli","prety","formatting","colors","output"],"repository":{"type":"git","url":"https://github.com/keepitcool/prettyoutput.git"},"author":{"name":"Nadim","email":"nadim.boustani@gmail.com","url":"https://github.com/bnadim"},"bugs":{"url":"https://github.com/keepitcool/prettyoutput/issues"},"license":"MIT","readmeFilename":"README.md","users":{"leonzhao":true}}