index.js
/**
	 * Register custom tags with the template engine
	 *
	 * @param {object} tags Object of functions
	 */
Register custom tags with the template engine
@param {object} tags Object of functions
Register custom tags with the template engine @param { object } tags Object of functions
async registerTags(tags) {
		function GetExtension(cb) {
			this.tags = ['get'];
			this.parse = (parser, nodes) => {
				const tok = parser.nextToken();
				const args = parser.parseSignature(null, true);
				parser.advanceAfterBlockEnd(tok.value);
				return new nodes.CallExtensionAsync(this, 'run', args, cb);
			};
			this.run = async (context, args, cb) => {
				const key = args instanceof Object && Object.keys(args).find(arg => arg !== '__keywords');
				context.ctx[key] = await tags.get(args[key], args.role ? args.role : null);
				if (cb) {
					cb();
				}
			};
		}
		this.engine.addExtension('GetExtension', new GetExtension());
	}
async registerTags ( tags ) { function GetExtension ( cb ) { this . tags = [ 'get' ] ; this . parse = ( parser , nodes ) => { const tok = parser . nextToken ( ) ; const args = parser . parseSignature ( null , true ) ; parser . advanceAfterBlockEnd ( tok . value ) ; return new nodes . CallExtensionAsync ( this , 'run' , args , cb ) ; } ; this . run = async ( context , args , cb ) => { const key = args instanceof Object && Object . keys ( args ) . find ( arg => arg !== '__keywords' ) ; context . ctx [ key ] = await tags . get ( args [ key ] , args . role ? args . role : null ) ; if ( cb ) { cb ( ) ; } } ; } this . engine . addExtension ( 'GetExtension' , new GetExtension ( ) ) ; }
Register custom tags with the template engine
 @param {object} tags Object of functions
Register custom tags with the template engine @param { object } tags Object of functions
/* Set var based on fetched data */