consolidate
Advanced tools
Comparing version 0.13.0 to 0.13.1
{ | ||
"name": "consolidate", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"description": "Template engine consolidation library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -82,2 +82,18 @@ # Consolidate.js | ||
### Promises | ||
Additionally, all templates optionally return a promise if no callback function is provided. The promise represents the eventual result of the template function which will either resolve to a string, compiled from the template, or be rejected. Promises expose a `then` method which registers callbacks to receive the promise’s eventual value and a `catch` method which the reason why the promise could not be fulfilled. Promises allow more synchronous-like code structure and solve issues like race conditions. | ||
```js | ||
var cons = require('consolidate'); | ||
cons.swig('views/page.html', { user: 'tobi' }) | ||
.then(function (html) { | ||
console.log(html); | ||
}) | ||
.catch(function (err) { | ||
throw err; | ||
}); | ||
``` | ||
## Caching | ||
@@ -84,0 +100,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38231
207