
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
grunt-syncpack
Advanced tools
Synchronize and put only newer files into a temporary folder, use any compression plugin on these files then merge to relase folder, compatible with any gurnt plugin since no specific tweak needed.
Syncpack can be used to synchronize files from source to destination folder. Instead of copy files directly to destination folder, syncpack uses a action newerToTempFolder to copy these files into a temporary folder. you can use any custom compression plugins such as uglify or pngmin to compress these files in the temporary folder, then run other command mergeToRelease to put these newer compressed files to destination folder to finish the process.
Syncpack compares new files by using files mtime(modified time). To insure that files copied from temp folder to destination folder has same mtime, the mergeToRelease action updates every newer file mtime to the same source file mtime.
newerToTempFolder put newer files in temporary folder from source and destination folder comparison.
mergeToRelease copy files in temp folder to destination folder, temporary folder will be deleted afterward.
no grunt plugin compatibility issue when compress newer files, any plugin will works.
speed up packaging process, only files in the temporary folder needs to be compressed.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-syncpack --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-syncpack');
In your project's Gruntfile, add a section named syncpack to the data object passed into grunt.initConfig().
grunt.initConfig({
syncpack: {
getnew: {
options: {
action: "newerToTempFolder",
tempFolderName: "__temp__",
logDetail: true,
},
cwd: "source",
dest: "release",
src: ["**/*.js", "**/*.css", "**/*.html", "**/*.jpg", "**/*.png"],
expand: true
},
release: {
options: {
action: "mergeToRelease",
tempFolderName: "__temp__",
logDetail: true,
},
cwd: "source",
dest: "release",
src: ["**/*.js", "**/*.css", "**/*.html", "**/*.jpg", "**/*.png"],
expand: true
}
},
})
Type: String
Default : undefined
actions to perform, either "newerToTempFolder" or "mergeToRelease", see features section for more information
Type: String
Default : "__temp__"
the temporary folder name
Type: boolean
Default : false
detail console message of every files copied, always show in grunt --verbose mode
Type: String
Default : undefined
current working directory, the project source directory
Type: String
Default : undefined
the destination directory, usually the release directory that contains compressed files and ready for upload
Type: Array
Default : undefined
grunt provided file format, see globbing pattern for more detail.
Type: boolean
Default : true
grunt provided file format, make sure set to true to check every files in every folder.
module.exports = function (grunt) {
grunt.initConfig({
syncpack: {
getnew: {
options: {
action: "newerToTempFolder",
tempFolderName: "__temp__",
logDetail: false,
},
cwd: "source",
dest: "release",
src: ["**/*.js", "**/*.css", "**/*.html", "**/*.jpg", "**/*.png"],
expand: true
},
release: {
options: {
action: "mergeToRelease",
tempFolderName: "__temp__",
logDetail: false,
},
cwd: "source",
dest: "release",
src: ["**/*.js", "**/*.css", "**/*.html", "**/*.jpg", "**/*.png"],
expand: true
}
},
//compress all js , notice that cwd and dest are set to temporary folder created by syncpack
uglify: {
task: {
files: [{
expand: true,
cwd: '__temp__',
src: '**/*.js',
dest: '__temp__'
}]
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-syncpack');
//create a task that first move newer files to temporary folder, use uglify compress these files in temporary folder, then move to release folder
grunt.task.registerTask("default", ["syncpack:getnew", "uglify", "syncpack:release"]);
};
2014.9.21 initial release
Copyright (c) 2014 Amo Yeh. Licensed under the MIT license.
FAQs
Synchronize and put only newer files into a temporary folder, use any compression plugin on these files then merge to relase folder, compatible with any gurnt plugin since no specific tweak needed.
The npm package grunt-syncpack receives a total of 0 weekly downloads. As such, grunt-syncpack popularity was classified as not popular.
We found that grunt-syncpack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.