{"id":22185064,"url":"https://github.com/chientrm/json2dir","last_synced_at":"2025-07-30T05:07:44.020Z","repository":{"id":41085002,"uuid":"508240920","full_name":"chientrm/json2dir","owner":"chientrm","description":"Convert JSON object to directory tree. Auto mkdir recursively.","archived":false,"fork":false,"pushed_at":"2023-01-08T22:49:38.000Z","size":210,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-23T18:56:03.042Z","etag":null,"topics":["fs","js","json","serialize"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chientrm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T09:47:16.000Z","updated_at":"2022-08-15T08:14:04.000Z","dependencies_parsed_at":"2023-02-08T07:46:01.595Z","dependency_job_id":null,"html_url":"https://github.com/chientrm/json2dir","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/chientrm/json2dir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chientrm%2Fjson2dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chientrm%2Fjson2dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chientrm%2Fjson2dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chientrm%2Fjson2dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chientrm","download_url":"https://codeload.github.com/chientrm/json2dir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chientrm%2Fjson2dir/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267814794,"owners_count":24148329,"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-07-30T02:00:09.044Z","response_time":70,"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":["fs","js","json","serialize"],"created_at":"2024-12-02T10:14:57.499Z","updated_at":"2025-07-30T05:07:43.978Z","avatar_url":"https://github.com/chientrm.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/chientrm"],"categories":[],"sub_categories":[],"readme":"# json2dir\n\n[![CI](https://github.com/chientrm/json2dir/actions/workflows/ci.yml/badge.svg)](https://github.com/chientrm/json2dir/actions/workflows/ci.yml)\n[![](https://img.shields.io/bundlephobia/min/json2dir)](https://www.npmjs.com/package/json2dir)\n[![](https://img.shields.io/discord/457912077277855764)](https://discord.com/invite/yy75DKs)\n[![](https://img.shields.io/npm/v/json2dir)](https://www.npmjs.com/package/json2dir)\n[![](https://img.shields.io/npm/dt/json2dir)](https://www.npmjs.com/package/json2dir)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e3c021b173854e749d48bb8db2a789ed)](https://www.codacy.com/gh/chientrm/json2dir/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=chientrm/json2dir\u0026utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/e3c021b173854e749d48bb8db2a789ed)](https://www.codacy.com/gh/chientrm/json2dir/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=chientrm/json2dir\u0026utm_campaign=Badge_Coverage)\n\n-   Convert JSON object to directory tree\n-   Auto `mkdir` recursively\n-   Zero dependencies\n-   Lightweight ~1 KB\n\n## Install\n\n```bash\nnpm install json2dir\n```\n\n## Types\n\n```ts\njson2dir(\n    dir: string,\n    serializers: Record\u003cstring, (obj: any) =\u003e string\u003e,\n    obj: any\n) : void\n```\n\n## Usage\n\n```ts\nimport json2dir from 'json2dir'\nimport ini from 'ini'\n\nconst bob = { name: 'Bob', age: 23 }\n\njson2dir(\n    '/root',\n    {\n        '.ini': ini.encode,\n        '.json': JSON.stringify\n    },\n    {\n        'a.json': bob,\n        'b.ini': { INFO: bob },\n        c: { d: { 'e.json': bob } },\n        '.sub/foo.bar/f.json': bob\n    }\n)\n```\n\n### Results\n\n```bash\n/root\n│   a.json\n│   b.json\n│\n└───c/d\n│   │\n│   │   e.json\n│\n└───.sub/foo.bar\n    │\n    │   f.json\n```\n\n### Exceptions\n\nIf serializer is not provided, an exception will occur.\nFor example: `Error: No serializer for extension '.json'`\n\n## Sponsor\n\n\u003cimg src=\"https://www.gitpod.io/svg/media-kit/logo-light-theme.svg\" width=\"200\"\u003e\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg\" width=\"50\"\u003e\n\n\u003ca href=\"https://www.buymeacoffee.com/chientrm\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"60\" width=\"217\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchientrm%2Fjson2dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchientrm%2Fjson2dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchientrm%2Fjson2dir/lists"}