package
One-way synchronization of directories with glob
npm install syncyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
One-way synchronization of directories with glob.
$ npm i -S syncyconst syncy = require('syncy');
syncy(['src/**', '!src/folder/**'], 'dest')
.then(() => {
console.log('Done!');
})
.catch(console.error);syncy(patterns, dest, [options])string|string[]Glob patterns that represent files to copy
string|string[]Destination directory or directories.
object{
// Display log messages when copying and removing files
verbose: false,
// Or create your own function.
verbose: (stamp) {
// action - `copy` or `remove`
// to - only for `copy` action
console.log(stamp.action + ' | ' + stamp.from + ' | ' + stamp.to);
},
// The base path to be removed from the path. Default: none
base: 'base_path'
// Remove all files from dest that are not found in src. Default: true
updateAndDelete: true,
// Never remove js files from destination. Default: false
ignoreInDest: '**/*.js'
}const gulp = require('gulp');
const syncy = require('syncy');
gulp.task('sync', (done) => {
syncy(['node_modules/gulp/**'], 'dest')
.then(() => {
done();
})
.catch((err) => {
done(err);
});
});const syncy = require('syncy');
module.exports = (grunt) => {
// Default task(s).
grunt.registerTask('default', function() {
const done = this.async();
syncy(['node_modules/grunt/**'], 'dest')
.then(() => {
done();
})
.catch((err) => {
done(err);
});
});
};Tech specs:
Files: AngularJS from release v1.6.0-rc.1.
Note: UpdateAndDelete option is enabled in the grunt-sync, because other plugins have this option initially.
| Description of tests | syncy | gulp-directory-sync | grunt-sync |
|---|---|---|---|
| First run | 3,7s | 9,1s | 10,1s |
| Re-run | 0,7s | 1,0s | 0,8s |
| Delete single file from dest directory | 0,7s | 0,9s | 0,8s |
See the Releases section of our GitHub project for changelogs for each release version.
This software is released under the terms of the MIT license.
Estimated unpacked size across 33 packages.
4.8 MB
Includes dependencies.
6.0.2