magical-move

0.3.1 • Public • Published

magical-move NPM version NPM downloads Build Status

mv with data replacement.

If you wanna copy and parse content, use mem-fs-editor instead.

Install

$ npm install --save magical-move

Usage

const move = require('magical-move')
 
/** source.js, in nunjucks template syntax:
hello {{ name }}
*/
async function main() {
    await move('./source.js', './output.js', {name: 'egoist'})
}
/** output.js:
hello egoist
*/

CLI

Install

$ npm install -g magical-move

Usage

# same result as above 
$ move source.js output.js --name egoist

API

move(from, to, [data, nunjucksOptions])

from String source file

to String output file

data Object The data to render template

nunjucksOptions https://mozilla.github.io/nunjucks/api.html#configure

move.sync

Same options but synchronously.

License

MIT © EGOIST

Readme

Keywords

Package Sidebar

Install

npm i magical-move

Weekly Downloads

3

Version

0.3.1

License

MIT

Last publish

Collaborators

  • kchan