{"id":15415050,"url":"https://github.com/sukkaw/rcpy","last_synced_at":"2025-04-19T12:57:55.523Z","repository":{"id":202916317,"uuid":"706091744","full_name":"SukkaW/rcpy","owner":"SukkaW","description":"Lightweight, fast, simple and flexible file copy utility for Node.js","archived":false,"fork":false,"pushed_at":"2024-11-05T15:22:10.000Z","size":322,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T13:55:53.182Z","etag":null,"topics":["copy","cp","cpr","nodejs","recursive-copy"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/SukkaW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-10-17T09:37:00.000Z","updated_at":"2024-11-05T15:22:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f6e2207-6387-42a2-a352-7b257ce73087","html_url":"https://github.com/SukkaW/rcpy","commit_stats":null,"previous_names":["sukkaw/rcpy"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Frcpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Frcpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Frcpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Frcpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SukkaW","download_url":"https://codeload.github.com/SukkaW/rcpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234841994,"owners_count":18895143,"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":["copy","cp","cpr","nodejs","recursive-copy"],"created_at":"2024-10-01T17:05:45.573Z","updated_at":"2025-01-20T19:07:45.338Z","avatar_url":"https://github.com/SukkaW.png","language":"TypeScript","funding_links":["https://github.com/sponsors/SukkaW/"],"categories":[],"sub_categories":[],"readme":"## rcpy\n\n\u003e **r**ecursive **c**o**py**\n\nCopy a file or directory. The directory can have contents.\n\n`rcpy` serves as a drop-in replacement of `ncp` and `fs-extra`'s `copy` function (`rcpy` passes most of `fs-extra`'s test cases). It can also be used as a polyfill for Node.js `fs.cp` API.\n\n## Installation\n\n```bash\n# npm\nnpm i rcpy\n# yarn\nyarn add rcpy\n# pnpm\npnpm i rcpy\n```\n\n## Usage\n\n```js\n// CommonJS\nconst { rcpy } = require('rcpy');\n// or\nconst { copy } = require('rcpy'); // \"copy\" is an alias of \"rcpy\"\n\n// ES Module\nimport { rcpy } from 'rcpy';\n// or\nimport { copy } from 'rcpy'; // \"copy\" is an alias of \"rcpy\"\n\n(async () =\u003e {\n  await copy(src, dest, options);\n})();\n```\n\n- `src`: `string` The path of the file/directory to copy. Note that if `src` is a directory it will copy everything inside of this directory, not the entire directory itself.\n- `dest`: `string` The destination of the copied file/directory. Note that currently if `src` is a file, `dest` cannot be a directory. This behavior might be changed in the future.\n- `option`: `RcpyOption` optional.\n  - `dereference`: `boolean` optional. Whether to dereference symbolic links, default to `false`.\n  - `force`: `boolean` optional. Whether to overwrite existing file/directory, default to `true`. Note that the copy operation will silently fail if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior.\n  - `overwrite`: `boolean` optional. Deprecated, now is the alias of `force`. Serves as a compatibility option for `fs-extra`.\n  - `errorOnExist`: `boolean` optional. Whether to throw an error if `dest` already exists, default to `false`.\n  - `filter`: `(src: string, dest: string) =\u003e boolean | Promise\u003cboolean\u003e` optional. Filter copied files/directories, return `true` to copy, `false` to skip. When a directory is skipped, all of its contents will be skipped as well.\n  - `mode`: `number` optional. Modifiers for copy operation, default to `0`. See `mode` flag of [`fs.copyFile()`](https://nodejs.org/api/fs.html#fscopyfilesrc-dest-mode-callback)\n  - `preserveTimestamps`: `boolean` optional. Whether to preserve file timestamps, default to `false`, where the behavior is OS-dependent.\n  - `concurrency`: `number` optional. The number of concurrent copy operations, default to `32`.\n\n## Differences between `rcpy` and `fs-extra`\n\n- Doesn't use `graceful-fs` to prevent `EMFILE` error.\n  - `rcpy` instead provides a `concurrency` option to limit the number of concurrent copy operations.\n- Asynchronous and Promise-based API only. No synchronous API, no Node.js callback style API.\n  - Use `require('util').callbackify` to convert `rcpy` to Node.js callback style API.P\n\n## Differences between `rcpy` and Node.js `fs.cp()`\n\n- Doesn't support `URL` for `src` and `dest`.\n  - PR is welcome to add `file://` support.\n- Doesn't support `recursive` option.\n  - `rcpy` will always copy directories' content recursively.\n  - PR is welcome to add this option.\n- Doesn't support `verbatimSymlinks` option.\n  - `rcpy` will always perform path resolution for symlinks if `dereference` option is enabled.\n  - PR is welcome to add this option.\n- Extra `concurrency` option.\n  - `rcpy` will use this option to limit the number of concurrent copy operations to prevent `EMFILE` error.\n\n## License\n\n[MIT](./LICENSE)\n\n----\n\n**rcpy** © [Sukka](https://github.com/SukkaW), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by Sukka with help from contributors ([list](https://github.com/SukkaW/rcpy/graphs/contributors)).\n\n\u003e [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Mastodon [@sukka@acg.mn](https://acg.mn/@sukka) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Keybase [@sukka](https://keybase.io/sukka)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sponsors/SukkaW/\"\u003e\n    \u003cimg src=\"https://sponsor.cdn.skk.moe/sponsors.svg\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Frcpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukkaw%2Frcpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Frcpy/lists"}