packages/cloud-formation/src/index.js
function loadTemplate(templatePath, identifier) {
  return plugin.myrmex.fire('beforeTemplateLoad', templatePath, identifier)
  .spread((templatePath, name) => {
    const templateDoc = _.cloneDeep(require(path.join(templatePath)));

    // Lasy loading because the plugin has to be registered in a Myrmex instance before requiring the document
    const Template = require('./template');
    const template = new Template(templateDoc, identifier);

    // This event allows to inject code to alter the template configuration
    return plugin.myrmex.fire('afterTemplateLoad', template);
  })
  .spread(template => {
    return Promise.resolve(template);
  });
}
function loadTemplate(templatePath, identifier) {
  return plugin.myrmex.fire('beforeTemplateLoad', templatePath, identifier)
  .spread((templatePath, name) => {
    const templateDoc = _.cloneDeep(require(path.join(templatePath)));

    // Lasy loading because the plugin has to be registered in a Myrmex instance before requiring the document
    const Template = require('./template');
    const template = new Template(templateDoc, identifier);

    // This event allows to inject code to alter the template configuration
    return plugin.myrmex.fire('afterTemplateLoad', template);
  })
  .spread(template => {
    return Promise.resolve(template);
  });
}
function loadTemplate ( templatePath , identifier ) { return plugin . myrmex . fire ( 'beforeTemplateLoad' , templatePath , identifier ) . spread ( ( templatePath , name ) => { const templateDoc = _ . cloneDeep ( require ( path . join ( templatePath ) ) ) ; // Lasy loading because the plugin has to be registered in a Myrmex instance before requiring the document const Template = require ( './template' ) ; const template = new Template ( templateDoc , identifier ) ; // This event allows to inject code to alter the template configuration return plugin . myrmex . fire ( 'afterTemplateLoad' , template ) ; } ) . spread ( template => { return Promise . resolve ( template ) ; } ) ; }
Load a Template object
@param  {string} templatePath - path to the template file
@param  {string} identifier - identifier od the template
@return {Promise<Template>} - promise of a Cloud Formation template
Load a Template object