Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jaxgeller/lodash-template-stream
- Owner: jaxgeller
- Created: 2014-09-12T19:48:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-12T20:32:39.000Z (over 10 years ago)
- Last Synced: 2023-09-19T18:47:05.581Z (over 1 year ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)