https://github.com/hash-bang/fs-copy-simple
Exceptionally simple module to just copy-the-damn-file. No globs, just copy
https://github.com/hash-bang/fs-copy-simple
Last synced: 2 months ago
JSON representation
Exceptionally simple module to just copy-the-damn-file. No globs, just copy
- Host: GitHub
- URL: https://github.com/hash-bang/fs-copy-simple
- Owner: hash-bang
- License: mit
- Created: 2016-04-26T07:19:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-02T01:36:55.000Z (almost 9 years ago)
- Last Synced: 2025-03-09T02:33:45.830Z (3 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fs-copy-simple
==============
Exceptionally simple module to just **copy-the-damn-file**. No globs, no weirdness, just copy.Pretty much everything that is not a valid input and output file name will callback with an error.
Written in frustration that all NPM copy libraries seem to spend an inordinate amount of time doing complex globbing and other fluff. If you want entire directory tree copying either use a higher level library such as [fs-extra](https://github.com/jprichardson/node-fs-extra) or couple this module with something that can recuse like [file-emitter](https://www.npmjs.com/package/file-emitter).
copy('/something/somewhere.thing', '/something/somewhere.else', function(err) {
console.log('Copied with error:', err);
});copy(src, dst, callback)
========================
Pass in a source path (or buffer), a destination path (or directory) and a callback for errors. Thats it.This function will error on non-existant files, trying to copy a directory to another directory or pretty much anything thats not a valid source file to either a destination path OR a directory to copy into.