{"id":18647686,"url":"https://github.com/artcom/content-importer","last_synced_at":"2025-09-12T04:41:33.200Z","repository":{"id":142420068,"uuid":"161497999","full_name":"artcom/content-importer","owner":"artcom","description":"Generates a file hierarchy using the content of a csv file","archived":false,"fork":false,"pushed_at":"2019-04-18T15:50:40.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-17T19:37:59.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artcom.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-12T14:12:21.000Z","updated_at":"2019-04-18T15:50:41.000Z","dependencies_parsed_at":"2024-04-19T07:00:25.945Z","dependency_job_id":null,"html_url":"https://github.com/artcom/content-importer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/artcom/content-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fcontent-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fcontent-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fcontent-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fcontent-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artcom","download_url":"https://codeload.github.com/artcom/content-importer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artcom%2Fcontent-importer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274754446,"owners_count":25343021,"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-09-12T02:00:09.324Z","response_time":60,"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":"2024-11-07T06:27:26.357Z","updated_at":"2025-09-12T04:41:33.171Z","avatar_url":"https://github.com/artcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Content-Importer\nReads a **csv file** and uses its information to generate **index.json** files and their **template.json** files with a hierarchical file structure.\n\n### Examples\n#### Generated File Hierarchy:\n````\n- root\n  - content\n    - area\n      - index.json\n      - directoryA1\n        - index.json\n        - directoryB1\n          - index.json\n        - directoryB2\n          - index.json\n          - directoryC1\n            - index.json\n  - templates\n    - directoryA1.json\n    - directoryA1DirectoryB1.json\n    - directoryA1DirectoryB2.json\n    - directoryA1DirectoryB2DirectoryC1.json\n````\n\n#### File Content:\n- **index.json**\n````\n{\n  \"template\": \"templateName\",\n  \"fieldName1\": {\n    \"de\": \"german field content\",\n    \"en\": \"english field content\"\n  }\n}\n````\n\n- **template.json**\n````\n{\n  \"children\": [\n    \"templateNameChildDir1\",\n    \"templateNameChildDirN\"\n  ],\n  \"fields\": [\n    {\n      \"name\": \"fieldName1\",\n      \"type\": \"text\"\n    }\n  ]\n}\n````\n\n## Usage\n\n### CSV\nAn example csv file can be found in the content folder.\n\n#### CSV Configuration:\n- **Encoding:** UTF-16 LE\n  -  **In MS Excel:** Save the file as \"UTF-16 Unicode-Text (.txt)\".\n- **Field Delimiter:** \\t (tabs)\n- **String Delimiter:** \"\n\n**Note**: The program skips the first 3 rows.\n\n#### Header Names:\n\n- **path** (e.g. \"dir1/dir2:fieldName\")\n- **textDE**\n- **textEN**\n- **type** (supported: \"string\", \"markdown\" and \"number\". If empty: string)\n\nHeader names are order sensitive. If the csv file contains other headers on top of the ones above, the headers array has to be adjusted in the **app.js**. Any other header can be exchange by an empty string.\n```\nheaders: [\"\", \"\", \"path\", \"\", \"\", \"textDE\", \"\", \"textEN\", \"\", \"\", \"type\"]\n```\n\n\n### Rules\nRules for the template name creation can be defined in a json file.\nA rule contains a **path** and the template name every child of the defined path will get.\n\n#### Syntax:\nWhen defining the path, '*' works as a wildcard. \\\nE.g. instead of defining the same rule for every element (element1, element2, ...) of an enumeration, using an asterisk will allow the same result with only one defined rule\n```bash\n{\n  \"rules\": [\n    {\n      \"path\": \"dir/elements/element*/options\",\n      \"template\": \"dirElementOption\"\n    }\n  ]\n}\n```\n\n#### Example:\nIf the given path is **_\"dir/elements/element4/options/option1\"_**,\napplying the rule above will result in the template name **_\"dirElementOption\"_**. \\\nIf no rule would be defined, the path would result in the template name **_\"dirElementsElement4OptionsOption1\"_**\n\n### Run\nA path to the **csv file** and to the **existing files / empty folder** must be declared.\nTo use the program, run the following CLI commands:\n\n```bash\nnpm install\nnpm start \u003cpath to csv\u003e \u003cimport/export path\u003e [\u003carea\u003e] [\u003cgenerate templates\u003e] [\u003crule path\u003e]\n```\n\n_(CLI parameters are order-sensitive)_\n\n- **\u003c path to csv \u003e** -\u003e path to csv file containing new content\n- **\u003c import/export path \u003e** -\u003e root directory path to existing content / empty folder\n- **\u003c area \u003e** (optional) -\u003e  area folder name in which the content should be created\n    (default: \"other\")\n- **\u003c generate templates \u003e** (optional) -\u003e boolean value if templates should be generated or not\n    (default: false)\n- **\u003c rule path \u003e** (optional) -\u003e path to the rule file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fcontent-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartcom%2Fcontent-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartcom%2Fcontent-importer/lists"}