{"id":16485301,"url":"https://github.com/morganconrad/metalsmith-cp-r","last_synced_at":"2025-07-24T21:34:27.399Z","repository":{"id":14125289,"uuid":"75979712","full_name":"MorganConrad/metalsmith-cp-r","owner":"MorganConrad","description":"A Metalsmith plugin to copy files recursively.","archived":false,"fork":false,"pushed_at":"2023-03-06T12:27:10.000Z","size":35,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T14:02:59.348Z","etag":null,"topics":["copy","metalsmith","metalsmith-plugin"],"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/MorganConrad.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":"2016-12-08T22:16:16.000Z","updated_at":"2021-10-01T00:32:48.000Z","dependencies_parsed_at":"2025-04-04T17:49:21.149Z","dependency_job_id":"73e59bd7-6378-4c77-9621-5e262ae9285a","html_url":"https://github.com/MorganConrad/metalsmith-cp-r","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MorganConrad/metalsmith-cp-r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Fmetalsmith-cp-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Fmetalsmith-cp-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Fmetalsmith-cp-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Fmetalsmith-cp-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorganConrad","download_url":"https://codeload.github.com/MorganConrad/metalsmith-cp-r/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Fmetalsmith-cp-r/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266905490,"owners_count":24004147,"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-07-24T02:00:09.469Z","response_time":99,"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":["copy","metalsmith","metalsmith-plugin"],"created_at":"2024-10-11T13:25:22.661Z","updated_at":"2025-07-24T21:34:27.340Z","avatar_url":"https://github.com/MorganConrad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/MorganConrad/metalsmith-cp-r.png)](http://travis-ci.org/MorganConrad/metalsmith-cp-r)\n[![License](http://img.shields.io/badge/license-MIT-A31F34.svg)](https://github.com/MorganConrad/metalsmith-cp-r)\n[![NPM Downloads](http://img.shields.io/npm/dm/metalsmith-cp-r.svg)](https://www.npmjs.org/package/metalsmith-cp-r)\n[![Known Vulnerabilities](https://snyk.io/test/github/morganconrad/metalsmith-cp-r/badge.svg)](https://snyk.io/test/github/morganconrad/metalsmith-cp-r)\n\n# metalsmith-cp-r\nA [Metalsmith](http://www.metalsmith.io/) plugin to copy files recursively.  Similar to [metalsmith-assets](https://www.npmjs.com/package/metalsmith-assets) but:\n * cp-r has minimal dependencies (only debug)\n * cp-r offers several additional options and controls\n\n### Usage\n\nInstall as usual,  `npm install metalsmith-cp-r`.\n\nJavascript:  `use(metalsmith-cp-r(options))`\n\nCLI: You'll lose a few options since you can't pass functions.\n\n#### Options\n\n**from**: the _contents_ of this directory, or this file, will be copied.  Defaults to \"_directory/assets\" (see below).\n\n**to**: \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; into this _directory_.  It will be created if necessary.  Defaults to \"_destination/assets\".\n\nIf **from** or **to** starts with _XXX/, they will be relative to that metalsmith property.  Common ones are:\n\n - _destination \u0026nbsp;\u0026nbsp;\u0026nbsp;see [metalsmith.destination()](https://github.com/metalsmith/metalsmith#destinationpath)\n - _source \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;see [metalsmith.source()](https://github.com/metalsmith/metalsmith#sourcepath)\n - _directory \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;see metalsmith.directory() or the constructor [Metalsmith(__dirname)](https://github.com/metalsmith/metalsmith#new-metalsmithdir)\n\n**Warning** If you use this feature, _you must use '/' (not a Windows '\\\\\\\\') as your folder delimiter._\n\n_e.g._ to copy from the working directory into the folder you set in `metalsmith.destination()` use\n\n`{ from: \"_directory/pathto/assets\", to: \"_destination/pathto/assets\"}`.\n\nOtherwise, the path will be resolved normally using `path.resolve()`.  (Sorry, if you really want to copy to or from a folder starting with _, the workaround is to start the path with a . or / or something...)\n\n\n#### Less common options, all default to null\n\n**noclobber**:  if truthy, don't overwrite existing files.  (Note:  cp-r never overwrites existing folders)\n\n**dirMode**\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;     e.g. 0o777 copied dirs will have this \"mode\",  default = use same mode as existing dir.\n\n**fileMode**\u0026nbsp;\u0026nbsp;\u0026nbsp;    e.g. 0o666 copied files will have this \"mode\", default = use same mode as existing file.\n\n**ignoreDir**\u0026nbsp;\u0026nbsp;   a string or Regex, if present, ignore directories matching this pattern.\n\n**ignoreFile**\u0026nbsp;\u0026nbsp;  a string or Regex, if present, ignore files matching this pattern.\n\n\n### Notes, Todos, and Caveats\n\ncp-r doesn't do any fancy async stuff - didn't seem worth it for a simple build script.  (It really feels \"un-nody\" because of all the synch stuff!)\n\ncp-r has not been tested with links, locked directories, bad inputs, other weird stuff.\n\nThe \"unit-test\" is pretty lame.  In package.json, please set scripts.test to the value for testWindows or testUnix as appropriate.\n\nI wrote this because [metalsmith-assets](https://www.npmjs.com/package/metalsmith-assets) had a ton of obsolete dependencies and wasn't actively processing issues and pull requests.  cp-r uses an absolute minimum of dependencies (only debug) and implements a few features from metalsmith-assets' feature requests.\n\n[metalsmith-assets-improved](https://www.npmjs.com/package/metalsmith-assets-improved) looks comparable. \n\n[metalsmith-copy-assets-540](https://www.npmjs.com/package/metalsmith-copy-assets-540) isn't recursive.\n\nIt's possible that [metalsmith-copy](https://github.com/mattwidmann/metalsmith-copy) does this better.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Fmetalsmith-cp-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganconrad%2Fmetalsmith-cp-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Fmetalsmith-cp-r/lists"}