grunt-file-wrap
v0.0.2
Published
Adds a header + footer into your text files automatically.
Downloads
392
Readme
grunt-file-wrap
Uses text-wrap to add a header + footer into your text files.
Installing
$ npm install grunt-file-wrap --save-dev
Example
module.exports = function (grunt) {
grunt.initConfig({
fileWrap: {
regular: {
header: 'header text', // if fileMode = true, it is a file name
footer: 'footer text', // if fileMode = true, it is a file name
files: {
// matching input and output will rewrite the source file;
"output1.txt": "input1.txt",
"output2.txt": "input2.txt"
},
options: {
// fileMode, skipCheck, unique
}
},
withCwd: {
header: 'header text', // if fileMode = true, it is a file name
footer: 'footer text', // if fileMode = true, it is a file name
src: ["files/*.txt"],
dest: "out/",
cwd: "./", // current working directory
options: {
// fileMode, skipCheck, unique
}
},
withRewrite: {
// in order to rewrite the source files, skip property 'dest':
header: 'header text', // if fileMode = true, it is a file name
footer: 'footer text', // if fileMode = true, it is a file name
src: ["files/*.txt"],
options: {
// fileMode, skipCheck, unique
}
}
}
});
grunt.loadNpmTasks('grunt-file-wrap');
grunt.registerTask('default', ['fileWrap']);
};
Options
fileMode ⇒ Boolean
false (default)
- contents ofheader
andfooter
is a plain texttrue
-header
andfooter
are file names from where to load the content
skipCheck, unique
Boolean options supported by text-wrap:
License
Copyright © 2016 Vitaly Tomilov; Released under the MIT license.