0.1.0 • Published 8 years ago
magical-mv v0.1.0
magical-mv
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
0.1.0
8 years ago