API class to manipulate nodes within AEM from node.

npm install aem-api@0.2.4



Warning this is under development. Tests are sparse or incomplete. Use at your own peril.


npm install --save-dev aem-api


Initialize and instance of aem-api with you credentials, then call any of the listed methods. They will all return a promise.

const AEM = require('aem-api');

const aem = new AEM('http://localhost', 4502, 'admin', 'admin');

  .then(_ => {
    console.log('Node successfully created')
  .catch(e => {
    console.error('Problem creating node', e);

Best Practises

This api returns promises by design even a synchronous response would suffice for ease of use, mainly with generators in mind. With this, it is recommended to use generators where possible for cleaner more readable code.

const AEM = require('aem-api');

const aem = new AEM('http://localhost', 4502, 'admin', 'admin');

const runner = function *() {
  const myNode = yield aem.createNode('/tmp/myNode');
  yield myNode.activate();
  console.warn(`Created my node and activated it, yay, pub o'clock?`);


  1. Change almost all response that return a promise to the http response. They're pretty much useless and should remain "behind closed doors". You only want a node object to mess with or an error. Then promise chaining becomes a lot more viable.
  2. Tests
  3. Economise on http requests where possible (Node#getProperties i'm looking at you...)
  4. Ability to lock and unlock nodes


HTML documentation can be viewed here