{"id":30180982,"url":"https://github.com/streamich/pojo-dump","last_synced_at":"2025-08-12T08:06:47.594Z","repository":{"id":306018000,"uuid":"1024743471","full_name":"streamich/pojo-dump","owner":"streamich","description":"Print JSON (or any POJO) to a nicely formatted human-readable text","archived":false,"fork":false,"pushed_at":"2025-07-23T08:14:32.000Z","size":126,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T09:29:42.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"streamich"}},"created_at":"2025-07-23T07:19:56.000Z","updated_at":"2025-07-23T08:23:16.000Z","dependencies_parsed_at":"2025-07-23T08:32:49.267Z","dependency_job_id":null,"html_url":"https://github.com/streamich/pojo-dump","commit_stats":null,"previous_names":["streamich/pojo-dump","streamich/json-dump"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/streamich/pojo-dump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpojo-dump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpojo-dump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpojo-dump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpojo-dump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamich","download_url":"https://codeload.github.com/streamich/pojo-dump/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fpojo-dump/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270024697,"owners_count":24514054,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-12T08:06:23.344Z","updated_at":"2025-08-12T08:06:47.583Z","avatar_url":"https://github.com/streamich.png","language":"TypeScript","funding_links":["https://github.com/sponsors/streamich"],"categories":[],"sub_categories":[],"readme":"# `pojo-dump`\n\nPrints a JSON structure (or any POJO) to the console. Can print to a single line\nor to a tree structure.\n\n\n## Installation\n\nInstall the package using NPM or Yarn:\n\n```bash\nnpm install pojo-dump\n# or\nyarn add pojo-dump\n```\n\n\n## Exports\n\nThe library provides the following exports:\n\n- `toLine`: Formats data into a compact, single-line JSON-like representation.\n- `toTree`: Formats data into a tree-like structure for better readability.\n- `logTree`: Logs the tree-like structure to the console.\n\n\n## Usage\n\nPrint to a single line:\n\n```js\nimport { toLine } from 'pojo-dump';\n\nconst data = [null, true, false, 123, 0.1, 'as\\ndf', [1, 2, 3], { foo: 'bar' }];\nconsole.log(toLine(data));\n// [ !n, !t, !f, 123, .1, \"as\" ⏎ \"df\", [ 1, 2, 3 ], { foo = \"bar\" } ]\n```\n\nPrint to a multi-line tree layout:\n\n```js\nimport { toTree } from 'pojo-dump';\n\nconst data = { foo: 'bar', nested: [1, 2, { key: 'value' }] };\nconsole.log(toTree(data));\n\n/*\nOutput:\n╿\n├─ foo = \"bar\"\n└─ nested\n   ├─ [0]: 1\n   ├─ [1]: 2\n   └─ [2]\n      └─ key = \"value\"\n*/\n```\n\n\n## Formatting choices\n\n- Constant literals:\n  ```ts\n  console.log(toLine([true, false, null, undefined]));\n  // Output: [ !t, !f, !n, !u ]\n  ```\n\n- Number literals:\n  ```ts\n  console.log(toLine([1000, 0.1]));\n  // Output: [ 1,000, .1 ]\n  ```\n\n- Formatting strings with special characters:\n  ```ts\n  console.log(toLine('hello\\nworld'));\n  // Output: \"hello\" ⏎ \"world\"\n  ```\n\n- Formatting binary data:\n  ```ts\n  console.log(toLine(new Uint8Array([104, 101, 108, 108, 111])));\n  // Output: Uint8Array { 68 65 6C 6C 6F }\n  ```\n\n\n## License\n\nApache 2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fpojo-dump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamich%2Fpojo-dump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fpojo-dump/lists"}