{"id":13526916,"url":"https://github.com/calvinmetcalf/copyfiles","last_synced_at":"2025-05-15T01:06:09.330Z","repository":{"id":15185642,"uuid":"17913659","full_name":"calvinmetcalf/copyfiles","owner":"calvinmetcalf","description":"copy files on the command line","archived":false,"fork":false,"pushed_at":"2024-07-11T00:08:12.000Z","size":142,"stargazers_count":419,"open_issues_count":55,"forks_count":53,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T14:16:51.111Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/calvinmetcalf.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2014-03-19T17:27:41.000Z","updated_at":"2025-04-03T18:30:29.000Z","dependencies_parsed_at":"2024-01-29T16:14:47.171Z","dependency_job_id":"4cb6c61a-21d0-41d1-be8f-e0b980035e96","html_url":"https://github.com/calvinmetcalf/copyfiles","commit_stats":{"total_commits":77,"total_committers":20,"mean_commits":3.85,"dds":0.4415584415584416,"last_synced_commit":"1bada65fab2051faf9ce2d69e44960a44b57711f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fcopyfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fcopyfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fcopyfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fcopyfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmetcalf","download_url":"https://codeload.github.com/calvinmetcalf/copyfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254040,"owners_count":22039792,"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":["hacktoberfest"],"created_at":"2024-08-01T06:01:37.394Z","updated_at":"2025-05-15T01:06:09.272Z","avatar_url":"https://github.com/calvinmetcalf.png","language":"JavaScript","funding_links":[],"categories":["Repository","JavaScript","Cross-platform Utilities"],"sub_categories":["Filesystem"],"readme":"copyfiles [![Build Status](https://travis-ci.org/calvinmetcalf/copyfiles.svg)](https://travis-ci.org/calvinmetcalf/copyfiles)\n===\n\ncopy files easily\n\n### Install\n\n```bash\nnpm install copyfiles -g\n```\n### Command Line\n\n```bash\n  Usage: copyfiles [options] inFile [more files ...] outDirectory\n\n  Options:\n    -u, --up       slice a path off the bottom of the paths               [number]\n    -a, --all      include files \u0026 directories begining with a dot (.)   [boolean]\n    -f, --flat     flatten the output                                    [boolean]\n    -e, --exclude  pattern or glob to exclude (may be passed multiple times)\n    -E, --error    throw error if nothing is copied                      [boolean]\n    -V, --verbose  print more information to console                     [boolean]\n    -s, --soft     do not overwrite destination files if they exist      [boolean]\n    -F, --follow   follow symbolink links                                [boolean]\n    -v, --version  Show version number                                   [boolean]\n    -h, --help     Show help                                             [boolean]\n```\n\ncopy some files, give it a bunch of arguments, (which can include globs), the last one\nis the out directory (which it will create if necessary).  Note: on windows globs must be **double quoted**, everybody else can quote however they please.\n\n```bash\ncopyfiles foo foobar foo/bar/*.js out\n```\n\nyou now have a directory called out, with the files foo and foobar in it, it also has a directory named foo with a directory named\nbar in it that has all the files from foo/bar that match the glob.\n\nIf all the files are in a folder that you don't want in the path out path, ex:\n\n```bash\ncopyfiles something/*.js out\n```\n\nwhich would put all the js files in `out/something`, you can use the `--up` (or `-u`) option\n\n```bash\ncopyfiles -u 1 something/*.js out\n```\n\nwhich would put all the js files in `out`\n\nyou can also just do -f which will flatten all the output into one directory, so with files ./foo/a.txt and ./foo/bar/b.txt\n\n```bash\ncopyfiles -f ./foo/*.txt ./foo/bar/*.txt out\n```\n\nwill put a.txt and b.txt into out\n\nif your terminal doesn't support globstars then you can quote them\n\n```bash\ncopyfiles -f ./foo/**/*.txt out\n```\n\ndoes not work by default on a mac\n\nbut\n\n```bash\ncopyfiles -f \"./foo/**/*.txt\" out\n```\n\ndoes.\n\nYou could quote globstars as a part of input:\n```bash\ncopyfiles some.json \"./some_folder/*.json\" ./dist/ \u0026\u0026 echo 'JSON files copied.'\n```\n\nYou can use the -e option to exclude some files from the pattern, so to exclude all files ending in .test.js you could do\n\n```bash\ncopyfiles -e \"**/*.test.js\" -f ./foo/**/*.js out\n```\n\nOther options include\n\n- `-a` or `--all` which includes files that start with a dot.\n- `-s` or `--soft` to soft copy, which will not overwrite existing files.\n- `-F` or `--follow` which follows symbolinks\n\n## copyup\n\nalso creates a `copyup` command which is identical to `copyfiles` but `-up` defaults to 1\n\n### Programic API\n\n```js\nvar copyfiles = require('copyfiles');\n\ncopyfiles([paths], opt, callback);\n```\ntakes an array of paths, last one is the destination path, also takes an optional argument which the -u option if a number, otherwise if it's `true` it's the flat option or if it is an object it is a hash of the various options (the long version e.g. up, all, flat, exclude, error, verbose, follow, and soft)  \n\n### Tilde support for home directory\nwhen the src/dest path start with tilde for home directory under windows, please make sure -u or -f is added in options or use copyup command. if not you will get `Error: Illegal characters in path.`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Fcopyfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmetcalf%2Fcopyfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Fcopyfiles/lists"}