8000 GitHub - mrmlnc/syncy at 2.0.0
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mrmlnc/syncy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SyncY

One-way synchronization of directories with glob.

Travis NPM version devDependency Status devDependency Status

Install

$ npm i -S syncy

Why?

  • Fast by using streams and Promises. Used cp-file and rimraf.
  • User-friendly by accepting globs.

Usage

const syncy = require('syncy');

syncy(['src/**', '!src/folder/**'], 'dest')
  .then(() => {
    console.log('Done!'); 
  })
  .catch(console.error);

API

syncy(glob, dest, [options])

glob

Type: array|string
Default: null

Glob pattern. Files to copy.

dest

Type: string
Default: null

Destination directory.

options

Type: object
Default: see options section

Module settings.

Options

{
  // Display log messages when copying and removing files
  verbose: false,
  // 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: false
  updateAndDelete: true,
  // Never remove js files from destination. Default: false
  ignoreInDest: '**/*.js'
}

How to work with Gulp?

const gulp = require('gulp');
const syncy = require('syncy');

gulp.task('sync', (done) => {
  syncy(['node_modules/gulp/**'], 'dest')
    .then(() => {
      done();
    })
    .catch((err) => {
      done(err);
    });
});

How to work with Grunt?

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);
      });
  });
};

Tests

Tech specs:

  • Intel Core i7-3610QM
  • RAM 8GB
  • SSD (555MB/S, 530MB/S)
  • Windows 10
  • Node.js v6.2.1

Files: AngularJS from release v1.5.6.

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 2,7s 6,0s 7,4s
Re-run 0,7s 0,9s 0,8s
Changed single file 0,7s 0,9s 0,8s
Delete images from destination directories and run 0,9s 1,2s 1,4s
Delete images from the source directory and run 1,1s 0,7s 1,3s

Changelog

See the Releases section of our GitHub project for changelogs for each release version.

License

This software is released under the terms of the MIT license.

About

📁 One-way synchronization of directories with glob

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0