magical-move
mv with data replacement.
Last updated 4 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install magical-move 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.1                                ...           latest (4 years ago)

6 Versions

  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |