
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
gulp-contensis-sync
Advanced tools
A Gulp plugin that allows you to push local files into your Contensis instance
contensis plugin for gulp
First, install gulp-contensis-sync as a development dependency:
npm install --save-dev gulp-contensis-sync
Then, add it to your gulpfile.js:
var gulpContensisSync = require('gulp-contensis-sync');
gulp.task('sync-contensis', function() {
// create a new contensisSync using options
var contensisSync = gulpContensisSync.create({
"user": "user",
"password": "pass",
"cmsUrl": "http://contensis-cms-url",
"project": "Project Name"
});
var options = { simulate: true, prefix: 'atlas'}
return gulp.src('./public/*.js')
.pipe(contensisSync.transfer(options))
// create a cache file to speed up consecutive uploads
.pipe(contensisSync.cache())
// Sync Directories, this will delete files at the other end.
.pipe(contensisSync.sync(options))
// print updates to console
.pipe(gulpContensisSync.reporter());
});
// output
// [gulp] [create] file1.js
// [gulp] [create] file2.js
// [gulp] [update] file3.js
// [gulp] [cache] file3.js
// ...
To run the deploy:
gulp sync-contensis
Create a Contensis Sync Instance.
The Config object is used to create a REST connection to Contensis. The cacheOptions object allows you to define the location of the cached hash digests. By default, they will be saved in your projects root folder in a hidden file called '.contensissync-' + 'name-of-your-project'.
For best practice you should add your contensis credentials to a json file:
{
"user": "user",
"password": "pass",
"cmsUrl": "http://full-cms-url",
"project": "Project Name"
}
You can then read it in with:
var fs = require('fs')
//Remember to add your contensis-credentials.json to your .gitignore, so no one else can use your details!
var credentials = JSON.parse(fs.readFileSync('../contensis-credentials.json', 'utf8'))
//Now you can create the object using the credentials
var contensisSync = gulpContensisSync.create(credentials);
Create a through stream, that transfers files to Contensis.
Files that go through the stream receive extra properties:
Note:
transferwill never delete files remotely. To clean up unused remote files usesync.
Create a through stream that create or update a cache file using file path and file ETag.
Consecutive runs of transfer and sync will use this file to avoid uploading identical files over and over.
Cache file is save in the current working dir and is named .contensissync-<projectName>. The cache file is flushed to disk every 10 files just to be safe.
Bear inb mind you may not want to use this if there are multiple people working, The sync is intelligent and will only upload changed files regardless of the cache.
create a transform stream that delete old files from Contensis.
e.g.
// only directory bar will be synced
// files in folder /foo/bar and file baz.txt will not be removed from Contensis despite not being in your local folder
var options = { simulate: false, prefix: 'atlas'}
gulp.src('./public/*')
.pipe(contensisSync.transfer(options))
.pipe(contensisSync.sync(options, [/^foo\/bar/, 'baz.txt']))
.pipe(gulpContensisSync.reporter());
warning
syncwill delete files in your Contensis instance that are not on your local folder unless they're whitelisted.
// this will transfer and sync files with the files in your public directory
// note that in Contensis the files in /public/ would end up directly in the root as we have provided no prefix.
var options = { simulate: false, prefix: ''}
gulp.src('./public/*')
.pipe(contensisSync.transfer(options))
.pipe(contensisSync.sync(options))
.pipe(gulpContensisSync.reporter());
// output
// [gulp] [create] file1.js
// [gulp] [update] file2.js
// [gulp] [delete] file3.js
// ...
Create a reporter that logs info.path and info.state (delete, create, update, cache, skip).
Available options:
// this will transfer local files and then sync to Contensis and print created, updated and deleted files
var options = { simulate: false, prefix: 'atlas'}
gulp.src('./public/*')
.pipe(contensisSync.transfer(options))
.pipe(contensisSync.sync(options))
.pipe(gulpContensisSync.reporter({
states: ['create', 'update', 'delete']
}));
FAQs
A Gulp plugin that allows you to push local files into your Contensis instance
We found that gulp-contensis-sync demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.