{"id":29189394,"url":"https://github.com/coderaiser/fs-copy-file-sync","last_synced_at":"2025-07-01T23:07:26.451Z","repository":{"id":57242180,"uuid":"103954528","full_name":"coderaiser/fs-copy-file-sync","owner":"coderaiser","description":"Nodejs fs.copyFileSync ponyfill ","archived":false,"fork":false,"pushed_at":"2019-12-21T14:56:10.000Z","size":60,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T02:41:28.365Z","etag":null,"topics":["copy-file","copy-file-sync","javascript","nodejs"],"latest_commit_sha":null,"homepage":"https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_copyfilesync_src_dest_flags","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/coderaiser.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-18T15:06:49.000Z","updated_at":"2020-10-04T20:21:29.000Z","dependencies_parsed_at":"2022-09-11T01:10:21.081Z","dependency_job_id":null,"html_url":"https://github.com/coderaiser/fs-copy-file-sync","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/coderaiser/fs-copy-file-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Ffs-copy-file-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Ffs-copy-file-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Ffs-copy-file-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Ffs-copy-file-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderaiser","download_url":"https://codeload.github.com/coderaiser/fs-copy-file-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderaiser%2Ffs-copy-file-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047676,"owners_count":23405280,"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-file","copy-file-sync","javascript","nodejs"],"created_at":"2025-07-01T23:07:25.663Z","updated_at":"2025-07-01T23:07:26.355Z","avatar_url":"https://github.com/coderaiser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"fs-copy-file-sync [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n=========\nNode.js v8.5.0 [fs.copyFileSync](https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_copyfilesync_src_dest_flags) [ponyfill](https://ponyfill.com).\n\nSynchronously copies src to dest. By default, dest is overwritten if it already exists. Returns undefined. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.\n\n## Install\n\n```\nnpm i fs-copy-file-sync\n```\n\n## API\n\n`flags` is an optional integer that specifies the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`).\n\n- `fs.constants.COPYFILE_EXCL` - The copy operation will fail if dest already exists.\n- `fs.constants.COPYFILE_FICLONE` - The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used.\n- `fs.constants.COPYFILE_FICLONE_FORCE` - The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail.\n\n\nExample:\n\n```js\nconst copyFileSync = require('fs-copy-file-sync');\n\n// destination.txt will be created or overwritten by default.\ncopyFileSync('source.txt', 'destination.txt');\nconsole.log('source.txt was copied to destination.txt');\n```\n\n\nIf the third argument is a number, then it specifies flags, as shown in the following example.\n\n```js\nconst copyFileSync = require('fs-copy-file-sync');\nconst { COPYFILE_EXCL } = copyFileSync.constants;\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\nfs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);\n```\n\n## Related\n\n- [fs-copy-file](https://github.com/coderaiser/fs-copy-file \"fs-copy-file\") - Asynchronously copies src to dest.\n- [fs-readdir-with-file-types](https://github.com/coderaiser/fs-readdir-with-file-types \"fs-readdir-with-file-types\") - Asynchronously read directory with file types.\n- [fs-readdir-sync-with-file-types](https://github.com/coderaiser/fs-readdir-sync-with-file-types \"fs-readdir-sync-with-file-types\") - Synchronously read directory with file types.\n\n## License\nMIT\n\n[NPMIMGURL]:                https://img.shields.io/npm/v/fs-copy-file-sync.svg?style=flat\u0026longCache=true\n[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/fs-copy-file-sync/master.svg?style=flat\u0026longCache=true\n[DependencyStatusIMGURL]:   https://img.shields.io/david/coderaiser/fs-copy-file-sync.svg?style=flat\u0026longCache=true\n[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\u0026longCache=true\n[CoverageIMGURL]:           https://coveralls.io/repos/coderaiser/fs-copy-file-sync/badge.svg?branch=master\u0026service=github\n[NPMURL]:                   https://npmjs.org/package/fs-copy-file-sync \"npm\"\n[BuildStatusURL]:           https://travis-ci.org/coderaiser/fs-copy-file-sync  \"Build Status\"\n[DependencyStatusURL]:      https://david-dm.org/coderaiser/fs-copy-file-sync \"Dependency Status\"\n[LicenseURL]:               https://tldrlegal.com/license/mit-license \"MIT License\"\n[CoverageURL]:              https://coveralls.io/github/coderaiser/fs-copy-file-sync?branch=master\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Ffs-copy-file-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderaiser%2Ffs-copy-file-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderaiser%2Ffs-copy-file-sync/lists"}