Skip to content

Commit

Permalink
Merge original consolidate.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Ip committed Sep 19, 2017
2 parents 8690e80 + c9a94a5 commit 6488d22
Show file tree
Hide file tree
Showing 16 changed files with 408 additions and 81 deletions.
30 changes: 28 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
.DS_Store
node_modules
# always ignore files
*.DS_Store
*.sublime-*
.idea
*.sock

# test related, or directories generated by tests
test/actual
actual
coverage
.nyc*

# npm
node_modules
npm-debug.log

# yarn
yarn.lock
yarn-error.log

# misc
_gh_pages
_draft
_drafts
bower_components
vendor
temp
tmp
TODO.md
package-lock.json
11 changes: 11 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
0.15.0 / 2017-09-18
===================

* add plates support
* add teacup support
* add liquid-node support
* add velocityjs support
* allow absolute and relative partial paths
* extend dot options
* support layouts in vash

0.14.0 / 2016-01-24
===================

Expand Down
14 changes: 5 additions & 9 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@
- [mote](https://github.com/satchmorun/mote) [(website)](http://satchmorun.github.io/mote/)
- [mustache](https://github.com/janl/mustache.js)
- [nunjucks](https://github.com/mozilla/nunjucks) [(website)](https://mozilla.github.io/nunjucks)
- [plates](https://github.com/flatiron/plates)
- [pug (formerly jade)](https://github.com/pugjs/pug) [(website)](http://jade-lang.com/)
- [QEJS](https://github.com/jepso/QEJS)
- [ractive](https://github.com/Rich-Harris/Ractive)
- [react](https://github.com/facebook/react)
- [slm](https://github.com/slm-lang/slm)
- [swig (unmaintained)](https://github.com/paularmstrong/swig)
- [teacup](https://github.com/goodeggs/teacup)
- [templayed](http://archan937.github.com/templayed.js/)
- [twig](https://github.com/justjohn/twig.js)
- [liquid](https://github.com/leizongmin/tinyliquid) [(website)](http://liquidmarkup.org/)
Expand Down Expand Up @@ -103,15 +105,9 @@ cons.swig('views/page.html', { user: 'tobi' })

## Caching

To enable or disable caching simply pass `{ cache: true/false }`. Engines _may_ use this option to cache things reading the file contents, compiled `Function`s etc. Engines which do _not_ support this may simply ignore it. All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments.

```js
var cons = require('consolidate');
cons.swig('views/page.html', { cache: false, user: 'tobi' }, function(err, html){
if (err) throw err;
console.log(html);
});
```
To enable caching simply pass `{ cache: true }`. Engines _may_ use this option to cache things reading the file contents, compiled `Function`s etc. Engines which do _not_ support this may simply ignore it. All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments.
When using consolidate directly: `cons.swig('views/page.html', { user: 'tobi', cache:true }, callback);`
Using Express 3 or higher: `app.locals.cache = true` or set NODE_ENV to 'production' and Express will do this for you.

## Express 3.x example

Expand Down
Loading

0 comments on commit 6488d22

Please sign in to comment.