2.0.1 • Published 7 years ago

file-interpolator v2.0.1

Weekly downloads
3
License
Unlicense
Repository
github
Last release
7 years ago

Build Status Test Coverage Code Climate Issue Count dependencies Status devDependencies Status

file-interpolator

Interpolates a file using placeholders. The file may be interpolated with strings or the content of another file.

It might be useful for generating files using a template/layout. The memory footprint has been highly taken into account (I hope?), so it should handle really big files.

Example:

var interpolator = require('../');
var path = require('path');

var layout = path.join(__dirname, 'files/layout.hbs');
var partial = path.join(__dirname, 'files/partial.hbs');
var outputFile = path.join(__dirname, 'files/output.hbs');

interpolator(layout, [{
	replace: '{{{ content }}}',
	withFile: partial
}, {
	replace: '{{ bundle.js }}',
	with: 'script tag with the js bundle right here'
}, {
	replace: '{{ bundle.css }}',
	with: 'link tag with the css bundle right here'
}], outputFile).then(function(outputFile) {
	console.log('finished the inteprolation process.. outputfile:', outputFile);
});
2.0.1

7 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago