{"_id":"@capaj/json-colorizer","_rev":"1-fe2cd392edac657b87f00cb2a5147b17","name":"@capaj/json-colorizer","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@capaj/json-colorizer","version":"3.0.0","description":"A library to format JSON with colors for display in the console","main":"src/lib/index.js","types":"src/lib/index.d.ts","scripts":{"test":"mocha src/test","test:watch":"mocha -w src/test","prettify":"prettier --write src/**/*.js","lint":"eslint src","prepare":"husky install"},"repository":{"type":"git","url":"git+ssh://git@github.com/joeattardi/json-colorizer.git"},"keywords":["json","colorize","console"],"authors":["Joe Attardi <jattardi@gmail.com> (http://joeattardi.codes)","Jiri Spac <capajj@gmail.com>"],"license":"MIT","bugs":{"url":"https://github.com/capaj/json-colorizer/issues"},"dependencies":{"colorette":"^2.0.16"},"devDependencies":{"chai":"^4.3.4","eslint":"^8.2.0","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.4","lint-staged":"^12.0.3","mocha":"^9.1.3","mocha-chai-jest-snapshot":"^1.1.3","prettier":"^2.4.1"},"lint-staged":{"src/**/*.js":["prettier --write","git add"]},"gitHead":"0210ad477c0f063f3a72ba76b1f12902682d3112","homepage":"https://github.com/joeattardi/json-colorizer#readme","_id":"@capaj/json-colorizer@3.0.0","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-HtMj4XrZcd0KZ8383xFaeHYg4SlmtqF+KGcHV73eoB4YneVt4x3rwTNiTEkGKqJb8LH3lTksswrQPtjpiWp9IQ==","shasum":"9b6b1a7f8652ae0ba8ed74a732a383c8161eb2b9","tarball":"https://registry.npmjs.org/@capaj/json-colorizer/-/json-colorizer-3.0.0.tgz","fileCount":7,"unpackedSize":6834,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl424CRA9TVsSAnZWagAAytgQAJ6jUGXJ3oe5P9FIQHYn\nHANZyCTLPh5TKmd3HK3/iCUM+2F6HL2FiiBaJLsIN+2dn/tDqpdhMguTZQZZ\nCehCHWh2uaBLCnkfRwYYM+3VXTioOh9KbIcIa36DXDBwKRfH5WtX7GWyUOzg\n5RFwJpiOgmatUD/l0BZ1vKfhFM98kmF3zfWm22P44o2FTxwjqQ4lN/PGtD8R\n6ibCK40nYvXjgiHP2WIkHEhvoi+t1XNdQynqSOAg50XCdYY06j9fd+cThY76\nwbaTu6OGaDezOYdoKUVcRAcehG35hiSF8YVHlslUOYYr1knLMovBYOZkx5L0\nAQDLS8UtKtViFWwonGSUZjy6zJqt0OfWVu70BXyLInygIdAjAdbTwQtWNpPg\newAZpMoCBm4Bvbtaim9quqD7V7V+xuHt6NZLgYJouxUi2vRsTQbm1aVGCNI3\n7hm1X1WeKJr+PM7i5A3bkx7QhfmFmoerKWXig9iGVBu2ooz6Ce64lJIkrGbr\nvix1Sr2hecAF8mhtU2lzzp6e3ZAC5l2nmoFKla7GiNQBEZ4dXvRJQwKY+7MD\nb421iX4vpMwQXeLDl27AbCOpNIZyrKu2h/hsaEzNSPfSqtlHFXii+HlYFfsm\nTvEDqHM2DsmJ+201t5MIaTvZFsZuQ/M0H9z9vAXFO5HqZmncQHkt2yzoEBXu\nWDQy\r\n=OOHB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkyy5QvyKOfRdxOAEdsYUb6NT0g7Gb89yRNtS0SaUx9AiEAvOb8okkRLqUP9d0ih5rZGS4foRN4tAvo7LnLmN4p0/M="}]},"_npmUser":{"name":"capaj","email":"capajj@gmail.com"},"directories":{},"maintainers":[{"name":"capaj","email":"capajj@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-colorizer_3.0.0_1637322168008_0.6736042877733119"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-19T11:42:47.954Z","3.0.0":"2021-11-19T11:42:48.202Z","modified":"2022-04-04T21:44:39.643Z"},"maintainers":[{"name":"capaj","email":"capajj@gmail.com"}],"description":"A library to format JSON with colors for display in the console","homepage":"https://github.com/joeattardi/json-colorizer#readme","keywords":["json","colorize","console"],"repository":{"type":"git","url":"git+ssh://git@github.com/joeattardi/json-colorizer.git"},"bugs":{"url":"https://github.com/capaj/json-colorizer/issues"},"license":"MIT","readme":"# json-colorizer\n\nA library for colorizing JSON strings\n\n![](https://raw.githubusercontent.com/joeattardi/json-colorizer/master/screenshot-colorette.png)\n\nThis package is a simple console syntax highlighter for JSON.\n\n## Installation\n\n`npm install --save json-colorizer`\n\n## Usage\n\n```js\nconst colorize = require('json-colorizer');\nconsole.log(colorize({ foo: 'bar' }));\n```\n\nIf you pass a string to the colorize function, it will treat it as pre-serialized JSON. This can be used in order to colorize pretty-printed JSON:\n\n```js\nconst colorize = require('json-colorizer');\nconst json = JSON.stringify({ foo: 'bar' }, null, 2);\nconsole.log(colorize(json));\n```\n\n## Pretty-printing output\n\nTo pretty-print the resulting JSON, pass the `pretty: true` option to the options object:\n\n```js\nconst colorize = require('json-colorizer');\nconst json = '{\"foo\": \"bar\"}';\nconsole.log(colorize(json, { pretty: true }));\n```\n\n## Specifying colors\n\nYou can specify a color to use for coloring individual tokens by providing a `colors` object in the options object. This should map token types to the names of color functions (see the [colorette styles reference](https://github.com/jorgebucaran/colorette#supported-colors)).\n\nA color can also be specified as a hex value starting with the `#` symbol.\n\n```js\nconst colorize = require('json-colorizer');\nconsole.log(\n  colorize(\n    { foo: 'bar' },\n    {\n      colors: {\n        STRING_KEY: 'green',\n        STRING_LITERAL: 'magentaBright',\n        NUMBER_LITERAL: 'blue'\n      }\n    }\n  )\n);\n```\n\nThe tokens available are:\n\n- `BRACE`\n- `BRACKET`\n- `COLON`\n- `COMMA`\n- `STRING_KEY`\n- `STRING_LITERAL`\n- `NUMBER_LITERAL`\n- `BOOLEAN_LITERAL`\n- `NULL_LITERAL`\n","readmeFilename":"README.md"}