{"id":26414936,"url":"https://github.com/gabeduartem/copy-paste-component","last_synced_at":"2025-06-22T04:05:34.770Z","repository":{"id":28403969,"uuid":"117397417","full_name":"GabeDuarteM/copy-paste-component","owner":"GabeDuarteM","description":"A tool to create components, by copying and pasting existing ones.","archived":false,"fork":false,"pushed_at":"2023-01-03T19:15:34.000Z","size":1777,"stargazers_count":5,"open_issues_count":73,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-12-19T17:57:07.824Z","etag":null,"topics":["boilerplate","cli","component","components","convention","conventions","copy","development","front-end","frontend","generate","generator","paste","pattern","patterns","scaffold","tool","web"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/copy-paste-component","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/GabeDuarteM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-14T03:07:58.000Z","updated_at":"2023-03-10T08:36:22.000Z","dependencies_parsed_at":"2022-08-17T21:05:15.020Z","dependency_job_id":null,"html_url":"https://github.com/GabeDuarteM/copy-paste-component","commit_stats":null,"previous_names":["GabrielDuarteM/copy-paste-component","gabrielduartem/copy-paste-component"],"tags_count":14,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fcopy-paste-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fcopy-paste-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fcopy-paste-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabeDuarteM%2Fcopy-paste-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabeDuarteM","download_url":"https://codeload.github.com/GabeDuarteM/copy-paste-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244130303,"owners_count":20402756,"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":["boilerplate","cli","component","components","convention","conventions","copy","development","front-end","frontend","generate","generator","paste","pattern","patterns","scaffold","tool","web"],"created_at":"2025-03-18T00:16:47.715Z","updated_at":"2025-03-18T00:16:48.203Z","avatar_url":"https://github.com/GabeDuarteM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# copy-paste-component\n\n[![travis](https://img.shields.io/travis/com/GabrielDuarteM/copy-paste-component/master.svg)](https://travis-ci.com/GabrielDuarteM/copy-paste-component)\n[![appveyor](https://img.shields.io/appveyor/ci/gabrielduartem/copy-paste-component/master.svg)](https://ci.appveyor.com/project/GabrielDuarteM/copy-paste-component)\n[![codecov](https://img.shields.io/codecov/c/github/GabrielDuarteM/copy-paste-component.svg)](https://codecov.io/gh/GabrielDuarteM/copy-paste-component)\n[![npm downloads](https://img.shields.io/npm/dw/copy-paste-component.svg)](https://www.npmjs.com/package/copy-paste-component)\n[![npm version](https://img.shields.io/npm/v/copy-paste-component.svg)](https://www.npmjs.com/package/copy-paste-component)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nA tool to create components, by copying and pasting existing ones.\n\n![Usage](https://thumbs.gfycat.com/ColorlessSelfassuredDonkey-max-14mb.gif)\n\nIf you have the structure below:\n\n```\nsrc/components/App/App.js\nsrc/components/App/App.test.js\nsrc/components/App/App.stories.js\nsrc/components/App/index.js\n```\n\nand run the tool, it will create the following structure, replacing occurrences of the word `App` inside the files to `NewApp`:\n\n```\nsrc/components/NewApp/NewApp.js\nsrc/components/NewApp/NewApp.test.js\nsrc/components/NewApp/NewApp.stories.js\nsrc/components/NewApp/index.js\n```\n\n## Installation\n\n`yarn global add copy-paste-component` or `npm i -g copy-paste-component`\n\n## Editor integration\n\nAre you looking for an editor extension? Check the ones available:\n\n- [Visual Studio Code](https://github.com/GabrielDuarteM/copy-paste-component-vscode)\n\n## Usage\n\nOn the root of your project, run `cpc` or `copy-paste-component`.\n\nIt will prompt you three questions:\n\n- `Which component would you like to copy?`\n- `What is the name of the new component?`\n- `What is the location of the new component?`\n\nWhen you answer those questions, it will generate a structure that is the same as the one that the selected component uses, but it will change the filename to the one you provided on the second question.\nIt will look too inside the file for occurrences of the filename, and if it finds, it replaces with the content of the second question.\n\nSo, given the following file:\n\n### App.js\n\n```js\nimport React from 'react'\n\nconst App = () =\u003e \u003cdiv\u003eHello World\u003c/div\u003e\n\nexport default App\n```\n\nBecomes the following:\n\n### NewApp.js\n\n```js\nimport React from 'react'\n\nconst NewApp = () =\u003e \u003cdiv\u003eHello World\u003c/div\u003e\n\nexport default NewApp\n```\n\nThere is also an option to skip the questions, providing them directly when you call the package, using the `copy` command, like `cpc copy src/components/App/App.js NewApp src/components/NewApp`. The first argument is the `path of the component you want to copy`, the second is the `name of the new component`, and the last one is the `path where the component will be created`.\n\n## Roadmap\n\nSee [Roadmap](https://github.com/GabrielDuarteM/copy-paste-component/projects/1)\n\n## Changelog\n\nSee [Releases](https://github.com/GabrielDuarteM/copy-paste-component/releases)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabeduartem%2Fcopy-paste-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabeduartem%2Fcopy-paste-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabeduartem%2Fcopy-paste-component/lists"}