Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.24 KB

File metadata and controls

50 lines (32 loc) · 1.24 KB

Async Pug

This repository contains async implementation of Pug template engine.

Original synchronous calls to file system has been replaced by async versions.

It became possible to use database as source of pug-files.

Package

via npm:

$ npm install pug-async

API

(async function () {

  var pug = require('pug-async');
  
  // compile
  var fn = await pug.compile('string of pug', options);
  var html = fn(locals);
  
  // render
  var html = await pug.render('string of pug', merge(options, locals));
  
  // renderFile
  var html = await pug.renderFile('filename.pug', merge(options, locals));

})().then(() => {}, err => { console.error(err); });

Maintained by Playcode

This package is maintained by Playcode, the AI website builder and AI app builder for creating, editing, hosting, and publishing live websites and web apps.

License

MIT