{"_id":"@adoyle.me/prettyoutput","_rev":"4-95044926b1bff40dc32bf17a200bdc84","name":"@adoyle.me/prettyoutput","dist-tags":{"latest":"1.3.2"},"versions":{"1.3.0":{"author":{"name":"adoyle","email":"adoyle.h@gmail.com"},"name":"@adoyle.me/prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.3.0","homepage":"http://github.com/adoyle-h/prettyoutput","keywords":["json","js","log","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/adoyle-h/prettyoutput.git"},"bugs":{"url":"https://github.com/adoyle-h/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":"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"},"dependencies":{"chalk":"^4.1.2","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"},"gitHead":"62b6d3878d7c984b60aad76e1ccbc374a3dfbeb8","_id":"@adoyle.me/prettyoutput@1.3.0","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-simk45VJO+g8bvxKpj94De0FMRq7/iSXKODR7dBdb1VURlKSwzqkDIeS7bJif9nlAtc7d9cMUgussl8g/3kYHw==","shasum":"cc599b3049b3a733292310e898d6bcdb7d295476","tarball":"https://registry.npmjs.org/@adoyle.me/prettyoutput/-/prettyoutput-1.3.0.tgz","fileCount":3,"unpackedSize":8708,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7kEg1rJtQDkWVt4og2onKcB7mhFrG+KXMsYLF//ZqVAiAwaE9ZP7suTHLjUarb2hHiAinkNauMqD+YAJ2PNZ8XVw=="}]},"_npmUser":{"name":"adoyle","email":"adoyle.h@gmail.com"},"directories":{},"maintainers":[{"name":"adoyle","email":"adoyle.h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prettyoutput_1.3.0_1632132965624_0.9160467710704834"},"_hasShrinkwrap":false},"1.3.1":{"author":{"name":"adoyle","email":"adoyle.h@gmail.com"},"name":"@adoyle.me/prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.3.1","homepage":"http://github.com/adoyle-h/prettyoutput","keywords":["json","js","log","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/adoyle-h/prettyoutput.git"},"bugs":{"url":"https://github.com/adoyle-h/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":"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"},"dependencies":{"chalk":"^4.1.2","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"},"gitHead":"f5b28f905ad8e9f10f6dd1e1cd9b8a4366ac6d1b","_id":"@adoyle.me/prettyoutput@1.3.1","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-41T6BdoX8pEF9mA4UYiml1q8C+6BICO1nHHM7LFQhGr/ndOq3gRprhWJKLcHLud3IKr2AmNZmvxzPygL0nhrOw==","shasum":"635f23540f820dc9c2d4e72571605521c80bfbd6","tarball":"https://registry.npmjs.org/@adoyle.me/prettyoutput/-/prettyoutput-1.3.1.tgz","fileCount":7,"unpackedSize":21434,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDv43U6Z9T6vLVFLYL19nk5tLkjnWi5lS5h2ClcueArcgIgDGJ/Ai6pNAhCk54kzfNy8ufcojepIgNEDEZtS6V1I3Q="}]},"_npmUser":{"name":"adoyle","email":"adoyle.h@gmail.com"},"directories":{},"maintainers":[{"name":"adoyle","email":"adoyle.h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prettyoutput_1.3.1_1632133364868_0.8531972244691988"},"_hasShrinkwrap":false},"1.3.2":{"author":{"name":"adoyle","email":"adoyle.h@gmail.com"},"name":"@adoyle.me/prettyoutput","description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","version":"1.3.2","homepage":"http://github.com/adoyle-h/prettyoutput","keywords":["json","js","log","prety","formatting","colors","output"],"engines":{"node":">=4"},"repository":{"type":"git","url":"git+https://github.com/adoyle-h/prettyoutput.git"},"bugs":{"url":"https://github.com/adoyle-h/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":"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"},"dependencies":{"chalk":"^4.1.2","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"},"gitHead":"1fd33c7e02d2ac8578750b6ac7dddcd8c066cf90","_id":"@adoyle.me/prettyoutput@1.3.2","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-RVRS+D66g9WNozxhrr8PSiyQFpHZojOT8Vy+faSi5ywB4f/Bx6xwa7NtKNzuE5kDh/6NgvkFUolZFaqBlaR8qg==","shasum":"477c29b6c095d3da3d0e6498e8f2b7722562f2d2","tarball":"https://registry.npmjs.org/@adoyle.me/prettyoutput/-/prettyoutput-1.3.2.tgz","fileCount":7,"unpackedSize":21782,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhv056CRA9TVsSAnZWagAAPdIP/1b1kr8t42ZgG5RQrAdK\ng76VPsUe2MZHjPb/IXX+nJdlk8gq7DNE1gcPeHBVVf34erw0lnUbPO+KT1w6\nN8/8rL6utEi158NX4yjYkOKlVqby2m6X1o0Pjv5TaeWcXR+cgHE0Wv5UxEYD\nFYXXcX8hUtcnHbHLAwekLatp171H/4R9U6Sz7Cz91/uCQ4HsQCs0jXu5wu7+\nFOF0szMGO5YBfZExMHMcrSubNzZVBx3PnAySPayAmWKiIrsyxAmsC7BDJbQ6\nmME6+/dUhqKUdPO//7t2jjvqDUezpKV+vhlQVhjXLjhawVAf5Fw9IganeURX\nfsjzSbAwFLRqFkKhr1ElV6DYL0K4J0lJ/tRTAbDV+FSqLDfbfZbXnD5vRNZ/\nxW4JIjHF4CEluHAwh1ByhHoD1OdqATtkPuWkYiQtq4RpmsV0W+V74ycYI4RT\nZoUVcsLvYgMDc6s5FQ43MkLIfv4L5tViQSoq7SPZTBhOe28WKJNfTFxgE+sw\n6EAgU5n7/eHkkg90S6NENrCrJAFVp308nivNK3aLq1SS3x+/A9/jHv/bvDNB\nCQJROk6XAjt9ptEQcccj0M/X1jR2NLbuHMCpXSWJkhKD2MrOP3RxulCvQL5O\nHWr6CUDdxntCitZnW2wsbYSl8IZ5jc8EEkp6RNuW85J1FTAeuOwzOEr0qi+i\n8klL\r\n=JP9q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDn0Mmsd+gjJ2L2ENrbVv3x5oToI9qIdMuwKBmucKzqZQIgatqpsMlt6FwUmlDF6V9vsDNOLNr8PTm/8vO53fxRUUc="}]},"_npmUser":{"name":"adoyle","email":"adoyle.h@gmail.com"},"directories":{},"maintainers":[{"name":"adoyle","email":"adoyle.h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prettyoutput_1.3.2_1632154280840_0.7340822147933173"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-20T10:16:05.537Z","1.3.0":"2021-09-20T10:16:05.746Z","modified":"2022-04-04T11:36:32.521Z","1.3.1":"2021-09-20T10:22:45.039Z","1.3.2":"2021-09-20T16:11:20.976Z"},"maintainers":[{"name":"adoyle","email":"adoyle.h@gmail.com"}],"description":"Librarie to format js/json objects into a YAML-style colored output. Especially useful to pretty print logs. Performant (benchmarks)","homepage":"http://github.com/adoyle-h/prettyoutput","keywords":["json","js","log","prety","formatting","colors","output"],"repository":{"type":"git","url":"git+https://github.com/adoyle-h/prettyoutput.git"},"author":{"name":"adoyle","email":"adoyle.h@gmail.com"},"bugs":{"url":"https://github.com/adoyle-h/prettyoutput/issues"},"license":"MIT","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 * {boolean} [emptyArrayMsg]     : Rendered message on empty array. Default: '(empty array)'\n * {boolean} [emptyObjectMsg]     : Rendered message on empty object. Default: '(empty object)'\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","readmeFilename":"README.md"}