Adobe AEM Synchronization Tool
Last updated 2 years ago by iamkumaran .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install aemsync--with-sling-option 
SYNC missed versions from official npm registry.


AEM (Adobe CQ) Synchronization Tool.


This is modified version of Used for my usage for prodcution deployment without pushing into AEM instance.

The tool pushes code changes to AEM instance(s) upon a file change.

  • There is no vault dependency.
  • It can push to multiple instances at the same time (e.g. author and publish).
  • IDE/editor agnostic.
  • Works on Windows, Linux and Mac.


With npm do:

npm install aemsync--with-sling-option -g



aemsync--with-sling-option -t targets -w path_to_watch

-t: Comma separated list of target hosts; default is http://admin:admin@localhost:4502.
-w: Folder to watch; default is current.
-i: Update interval; default is 300ms.
-e: Anymatch exclude filter; any file matching the pattern will be skipped.
-d: Enable debug mode.
aemsync--with-sling-option -t http://admin:admin@localhost:4502,http://admin:admin@localhost:4503 -w ~/workspace/my_project


// Import aemsync--with-sling-option.
const aemsync = require('aemsync--with-sling-option')

// Set up the environment.
let workingDir = '~/workspace/my_project'
let targets = [
let exclude = '**/*.orig' // Skip merge files.
let pushInterval = 300
let onPushEnd = (err, host) => {
  if (err) {
    return console.log(`Error when pushing package to ${host}.`, err)
  console.log(`Package pushed to ${host}.`)

aemsync({workingDir, targets, exclude, pushInterval, onPushEnd})


The Watcher uses Node's function to watch over directory changes recursively. For Windows and OSX the recursive option is used, which significantly improves the performance. Any changes inside jcr_root folders are detected and deployed to AEM instance(s) as a package. Rules:

  • Changes to first level directories under jcr_root are ingored. This is to avoid accidentally removing apps, libs or any other first level node in AEM.
  • The following are ignored by default: .svn, .git, .hg.

Update interval is the time the Pusher waits for file changes before the package is created. In case of multiple file changes (e.g. switching between code branches), creating a new package per file should be avoided and instead, all changes should be pushed in one go. Lowering the value decreases the delay for a single file change but may increase the delay for multiple file changes. If you are unsure, please leave the default value.

Note that some of the file changes will result in pushing the entire parent folder:

  • Ading, removing or renaming files or directories.
  • Changing .content.xml.
  • Changing any file or directory inside nt:unstructured subtree. In this case the first non nt:unstructured ancestor will be pushed. This behaviour ensures proper handling of self-contained unstructured blocks of nodes such as dialogs that are distributed across multiple files (see issue 19).

Known issues

Packages are installed using package manager service (/crx/packmgr/service.jsp), which takes some time to initialize after AEM startup. If the push happens before, the Sling Post Servlet will take over causing the /crx/packmgr/service.jsp/file node to be added to the repository.

Current Tags

  • 2.0.1                                ...           latest (2 years ago)

1 Versions

  • 2.0.1                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (7)
Dev Dependencies (0)

Copyright 2014 - 2016 © |