{"id":13801021,"url":"https://github.com/dpmland/deno-json-colorizer","last_synced_at":"2025-04-30T17:32:48.510Z","repository":{"id":41236865,"uuid":"508796664","full_name":"dpmland/deno-json-colorizer","owner":"dpmland","description":"A library for colorizing JSON strings for Deno","archived":false,"fork":false,"pushed_at":"2022-07-02T19:01:18.000Z","size":37,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T03:31:50.515Z","etag":null,"topics":["deno","deno-module","javascript","json","library","typescript"],"latest_commit_sha":null,"homepage":"https://deno.land/x/json_colorize","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpmland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-29T18:02:24.000Z","updated_at":"2024-10-25T14:56:35.000Z","dependencies_parsed_at":"2022-09-10T20:20:54.963Z","dependency_job_id":null,"html_url":"https://github.com/dpmland/deno-json-colorizer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpmland%2Fdeno-json-colorizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpmland%2Fdeno-json-colorizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpmland%2Fdeno-json-colorizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpmland%2Fdeno-json-colorizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpmland","download_url":"https://codeload.github.com/dpmland/deno-json-colorizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251751322,"owners_count":21637906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","deno-module","javascript","json","library","typescript"],"created_at":"2024-08-04T00:01:18.664Z","updated_at":"2025-04-30T17:32:48.152Z","avatar_url":"https://github.com/dpmland.png","language":"TypeScript","funding_links":[],"categories":["Modules","TypeScript"],"sub_categories":["String utils"],"readme":"# deno-colorize-json\n\n---\n\n![](./docs/image.JPG)\n\nA library for colorizing JSON strings for DENO\n\n\u003e _Adapted from the Node Version\n\u003e [json-colorizer](https://github.com/joeattardi/json-colorizer)_\n\n## Usage and Installation\n\n### Installation\n\n`dpm install json-colorize`\n\nOr import like:\n\n```ts\nimport { colorize } from 'https://deno.land/x/json_colorize/mod.ts';\n```\n\n### Usage\n\n```ts\nimport { colorize } from 'https://deno.land/x/json_colorize/mod.ts';\ncolorize('{ \\'foo\\': \\'bar\\' }');\n```\n\nIf you pass a string to the colorize function, it will treat it as\npre-serialized JSON. This can be used in order to colorize pretty-printed JSON:\n\n```ts\nimport { colorize } from 'https://deno.land/x/json_colorize/mod.ts';\nconst json = JSON.stringify({ 'foo': 'bar' }, null, 2);\ncolorize(json);\n```\n\nAnd you can save the content in a variable and not print with this:\n\n```ts\nimport { colorize } from 'https://deno.land/x/json_colorize/mod.ts';\n\nconst msg = colorize('{ \\'fooo\\': \\'baaar\\' }', { print: false });\n\nconsole.log(`Save in a variable ${msg}`);\n```\n\n#### Customization colors\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\nYou can custom like:\n\n```ts\nimport {\n  CODE_COLORS,\n  colorize,\n} from 'https://deno.land/x/json_colorize/mod.ts';\n\nconst example = {\n  aaaaaa: 'eeeee',\n  aaa: 2,\n  a: {\n    e: 'xd',\n  },\n};\n\ncolorize(JSON.stringify(example), {\n  colors: {\n    BRACE: CODE_COLORS.GRAY,\n    BRACKET: CODE_COLORS.GRAY,\n    COLON: CODE_COLORS.GRAY,\n    COMMA: CODE_COLORS.GRAY,\n    STRING_KEY: CODE_COLORS.BLUE,\n    STRING_LITERAL: CODE_COLORS.GREEN,\n    NUMBER_LITERAL: CODE_COLORS.YELLOW,\n    BOOLEAN_LITERAL: CODE_COLORS.BLUE,\n    NULL_LITERAL: CODE_COLORS.RED,\n  },\n});\n```\n\n## Information\n\n- **Author:** Teo\n- **Version:** 0.1.0\n- **License:** GNU General Public License v3.0\n\n---\n\nMade by [dpm](https://github.com/dpmland/dpm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpmland%2Fdeno-json-colorizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpmland%2Fdeno-json-colorizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpmland%2Fdeno-json-colorizer/lists"}