Socket
Socket
Sign inDemoInstall

consolidate

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

consolidate - npm Package Compare versions

Comparing version 0.13.0 to 0.13.1

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc