{"id":18358821,"url":"https://github.com/uppercod/tfolder","last_synced_at":"2025-04-10T03:02:41.335Z","repository":{"id":47852757,"uuid":"149550833","full_name":"UpperCod/tfolder","owner":"UpperCod","description":"create directories as template to explain using CLI, snippets folder","archived":false,"fork":false,"pushed_at":"2021-08-12T11:22:18.000Z","size":121,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-18T14:49:33.754Z","etag":null,"topics":[],"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/UpperCod.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":"2018-09-20T04:23:54.000Z","updated_at":"2020-07-11T03:29:15.000Z","dependencies_parsed_at":"2022-08-29T21:21:00.720Z","dependency_job_id":null,"html_url":"https://github.com/UpperCod/tfolder","commit_stats":null,"previous_names":["uppercod/template-folder"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Ftfolder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Ftfolder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Ftfolder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Ftfolder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpperCod","download_url":"https://codeload.github.com/UpperCod/tfolder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248148221,"owners_count":21055547,"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":[],"created_at":"2024-11-05T22:19:36.823Z","updated_at":"2025-04-10T03:02:41.288Z","avatar_url":"https://github.com/UpperCod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfolder\n\n![tfolder](https://res.cloudinary.com/dz0i8dmpt/image/upload/v1580658927/github/tfolder/carbon_1.png)\n\nWith tfolder you can copy the contents of a directory A to B with the advantage that the directory name and content of the files are processed by mustache, this with the idea of creating directories as a template,eg:\n\n```bash\ntfolder ./a ./b --data {\"name\":\"custom-name\"}\n\n./a/\n   {{name}}/\n      file-{{name}}.md\n./b/\n   custom-name/\n      file-custom-name.md\n```\n\n## Installation\n\n```bash\nnpm install -D tfolder-cli\n```\n\n## usage\n\nIt is recommended that you attach it locally to associate it with the scripts of your package.json, eg:\n\n```json\n{\n  \"scripts\": {\n    \"create-component\": \"tfolder ./create-component ./src/components\"\n  }\n}\n```\n\n## Flags\n\n- **-f, --force**: force the replacement of the files if they already exist\n- **-d, --data**: define a json object to share with tfolder.config.js\n- **-h, --help**: Show cli information\n\n## tfolder.config.js\n\ntfolder.config allows to intercept the configuration to be modified when executing the function of this file\n\n```js\nimport prompts from \"prompts\";\n\nconst questions = [\n  {\n    type: \"text\",\n    name: \"title\",\n    message: \"What is your GitHub username?\"\n  }\n];\n\nexport default function() {\n  return prompts(questions);\n}\n```\n\n**In the previous example by using [prompts](https://www.npmjs.com/package/prompts), included by default, you can add fields to use by your template.\nThis file should only be in the main directory of the template**\n\n## Example of use\n\n[Template directory for atomicojs/base](https://github.com/atomicojs/base/tree/create-webcomponents-with-bundle-cli/template/tfolder/component), in it you can see how to create a template for the generation of components.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Ftfolder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuppercod%2Ftfolder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Ftfolder/lists"}