I want to create a task in gulpfile.js that will append some text on a file. I do not want to use replace function as there is no particular string on the file that needs to be replaced.
If you want to append text on file at the top, you can use gulp-header package for that. You can install and use this as below
npm install --save-dev gulp-header
Now you can use it in your gulpfile.js
var header = require('gulp-header');
.pipe(header('Text to append'))
If you want to append text at the bottom of the file you can use gulp-footer. Below is the installation and usage information.
To Install gulp-footer in your project use npm command
npm install --save-dev gulp-footer
Now you can use gulp-footer in your gulpfile.js
var footer = require('gulp-footer');
.pipe(footer('Text to append'))