{"id":18055740,"url":"https://github.com/marinerer/simple-copy","last_synced_at":"2025-04-05T09:24:25.948Z","repository":{"id":57359930,"uuid":"160618898","full_name":"Marinerer/simple-copy","owner":"Marinerer","description":"Simple copy-cli, copy files \u0026 directories width glob","archived":false,"fork":false,"pushed_at":"2018-12-20T02:32:24.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T01:35:36.142Z","etag":null,"topics":["cli","copy","copyfile","directory","file","files","fs"],"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/Marinerer.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-12-06T04:31:29.000Z","updated_at":"2020-03-31T16:11:17.000Z","dependencies_parsed_at":"2022-09-06T22:22:26.906Z","dependency_job_id":null,"html_url":"https://github.com/Marinerer/simple-copy","commit_stats":null,"previous_names":["mengqing723/simple-copy","marinerer/simple-copy","meqn/simple-copy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fsimple-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fsimple-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fsimple-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marinerer%2Fsimple-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marinerer","download_url":"https://codeload.github.com/Marinerer/simple-copy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247313932,"owners_count":20918719,"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":["cli","copy","copyfile","directory","file","files","fs"],"created_at":"2024-10-31T01:11:44.629Z","updated_at":"2025-04-05T09:24:25.925Z","avatar_url":"https://github.com/Marinerer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-copy\n\n\u003e Simple copy-cli, copy files \u0026 directories width glob\n\n\n\n## Table of Contents\n\n- [Installation](#Installation)\n- [Usage](#Usage)\n- [Options](#Options)\n- [CLI](#CLI)\n\n\n\n\n## Installation\n\n```\nnpm install simple-copy --save-dev\n```\n\nor\n\n```\nyarn add -D simple-copy\n```\n\n\n\n## Usage\n\n\u003e ⚠️  Directory must end with `/` \n\neg. `/statics/images/`\n\n```js\nconst copy = require('simple-copy')\n\n// copy(srcPath, dstPath[, options, callback])\n\n\n\n/**\n * copy one file\n */\ncopy('images/banner.jpg', 'statics/img/bg.jpg')\n\n\n/**\n * copy files\n */\ncopy('images/*.jpg', 'statics/img/')\n// overwrite\ncopy('images/**', 'statics/img/')\n// do not overwrite\ncopy('images/**', 'statics/img/', { overwrite: false })\n\n\n\n/**\n * copy directory\n */\ncopy('images/', file =\u003e `statics/${Date.now()}/${file}`)\ncopy('images/**', file =\u003e `statics/${file}`)\n\n```\n\n\n\n## Options\n\n```js\ncopy(srcPath, dstPath[, options, callback])\n```\n\n- `src` `{String|Object|Array}` Pattern to be matched\n- `dest` `{String | Function}` Destination directory\n- `Options` `{Object}` flag or callback function.\n  - `overwrite` `{Boolean}`  Overwrite existing files\n  - `depth` `{Boolean}`  Recursive source directory\n- `cb` `{Function}` Called when an error occurs, or matches are found\n  - `error` `{Error | null}`\n  - `matches` `{Array\u003cString\u003e}` filenames found matching the pattern\n  - `currentIndex` `{Number}` The index of the current matching file\n\n\n\n\n## CLI\n\n\n```\nnpm install --global simple-copy\n```\n\nor  \n\n```\nyarn add -g simple-copy\n```\n\n\n### CLI Useage\n\n```\n$ scopy \u003csrc\u003e \u003cdest\u003e [...]\n\n$ scopy --help\n$ scopy -v\n```\n\n- `src`  Pattern to be matched\n- `dest`  Destination directory\n- `[options]`\n  - `-O` , `--no-overwrite`  Do not overwrite the destination \n  - `-D` , `--no-depth`  Do not recursive source directory \n\n\n\n### Example\n\n```bash\n# Clone media to statics\n$ scopy src/media/ dist/statics/\n\n$ scopy imgs/avatar.png imgs/*.jpg statics/\n\n# Copy the avatar image of the png to statics directory\n$ scopy imgs/avatar/*.png statics/ -D\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinerer%2Fsimple-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarinerer%2Fsimple-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinerer%2Fsimple-copy/lists"}