0.1.0 • Published 8 years ago

magical-mv v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

magical-mv NPM version NPM downloads Build Status

mv with data replacement.

Install

$ npm install --save magical-mv

Usage

const mv = require('magical-mv')

/** source.js:
hello {{ name }}
*/
mv('./source.js', './output.js', {name: 'egoist'})
	.then(content => {
		console.log('Done!')
	})
/** output.js:
hello egoist
*/

API

mv(from, to, data, handlebarsOpts)

from String source file

to String output file

data Object The data to render template

handlebarsOpts Object Options for handlebars.compile

mv.sync

Same options but synchronously.

License

MIT © EGOIST