taskr-rename
v1.0.0
Published
Rename plugin for Taskr
Downloads
14
Readme
taskr-rename
Rename plugin for Taskr
NOTE: This repository has been renamed from fly-rename to taskr-rename. If you haven't yet migrated to Taskr, now is the time to do so.
Install
$ yarn add -D taskr taskr-rename
or
$ npm install --save-dev taskr taskr-rename
Usage
Object
export default function* (task) {
yield task.source('./src/foo.js')
.rename({
dirname: 'dir/name',
basename: 'bar',
prefix: 'prefix-',
suffix: '-suffix',
extname: '.html'
})
.target('./dist')
// .dist/dir/name/prefix-bar-suffix.html
}
Function
export default function* (task) {
yield task.source('./src/foo.js')
.rename((file) => {
file.dirname = 'dir/name'
file.basename = 'bar'
file.extname = '.html'
})
.target('./dist')
// .dist/dir/name/bar.html
}