Copy files
- Fast by using streams.
- Resilient by using graceful-fs.
- User-friendly by accepting globs and creating non-existant destination directories.
- User-friendly error messages.
$ npm install --save cpy
const cpy = require('cpy');
cpy(['src/*.png', '!src/goat.png'], 'dist']).then(() => {
console.log('files copied');
});
Type: array
Files to copy.
Type: string
Destination directory.
Type: object
Options are passed to cp-file and glob.
Type: string
Default: process.cwd()
Working directory to find source files.
Type: boolean
Default: false
Preserve path structure.
Type: string
Filename used to rename every file in files
.
MIT © Sindre Sorhus