Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaxgeller/lodash-template-stream

Stream templates through lodash
https://github.com/jaxgeller/lodash-template-stream

Last synced: 16 days ago
JSON representation

Stream templates through lodash

Awesome Lists containing this project

README

        

# lodash-template-stream

[![Build Status](https://travis-ci.org/jacksongeller/lodash-template-stream.svg)](https://travis-ci.org/jacksongeller/lodash-template-stream)

### Install

`npm install lodash-template-stream --save`

### Use

```js
var fs = require('fs');
var lodashStreamer = require('lodash-template-stream');

var read = fs.createReadStream('./template.html');

read
.pipe(lodashStreamer({my:'obj'}))
.pipe(process.stdout);

```

### Examples

```html


<%= title %>


<%= heading%>



  • <%= li %>


<%= paragraph %>


```

```js
fs.createReadStream('./template.html')
.pipe(lodash({
title: 'this is the title',
heading: 'this is my headig',
li: 'this is my li',
paragraph: 'this is my paragraph'
}))
.pipe(fs.createWriteStream('./compiled.html'));
```

```html


this is my title


this is my heading



  • this is my li


this is my paragraph


```

[![forthebadge](http://forthebadge.com/badges/built-by-developers.svg)](http://forthebadge.com)