Skip to content
forked from pugjs/pug

Async version of Pug – robust, elegant, feature rich template engine for Node.js

Notifications You must be signed in to change notification settings

fiftin/pug-async

 
 

Repository files navigation

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); });

License

MIT

About

Async version of Pug – robust, elegant, feature rich template engine for Node.js

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.4%
  • Pug 17.5%
  • HTML 13.0%
  • Other 0.1%