New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

grunt-sync

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-sync

Task to synchronize two directories. Similar to grunt-copy but updates only files that have been changed.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
decreased by-3.08%
Maintainers
1
Weekly downloads
 
Created
Source

Grunt-sync

A grunt task to keep directories in sync. It is very similar to grunt-contrib-copy but tries to copy only those files that has actually changed.

Usage

npm install grunt-sync --save

Within your grunt file:

  grunt.initConfig({

    sync: {
      main: {
        files: [{
          cwd: 'src',
          src: [
            '**', /* Include everything */
            '!**/*.txt' /* but exclude txt files */
          ],
          dest: 'bin',
        }],
        ignoreInDest: "**/*.js", // Never remove js files from destination
        verbose: true // Display log messages when copying files
      }
    }

  });

  grunt.loadNpmTasks('grunt-sync');
  grunt.registerTask('default', 'sync');

More examples

sync: {
  main: {
    files: [
      {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs
      {cwd: 'path/', src: ['**/*.js', '**/*.css'], dest: 'dest/'}, // makes all src relative to cwd
    ],
    verbose: true,
    pretend: true, // Don't do any disk operations - just write log
    updateOnly: true // Don't remove any files from `dest` (works around 30% faster)

  }
}

Changelog

  • 0.1.0 - Files missing that are not in src are deleted from dest (unless you specify updateOnly)

TODO

Research if it's possible to have better integration with grunt-contrib-watch - update only changed files instead of scanning everything.

Keywords

FAQs

Package last updated on 25 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc