gulp-append-prepend-no-trim
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

gulp-append-prepend-no-trim

Fork from the original gulp-append-prepend by JamesHemery.


Simple Gulp plugin.

License:MIT npm Build

Usage

First, install gulp-append-prepend-no-trim as a development dependency:

npm install gulp-append-prepend-no-trim --save-dev

Then, add it to your gulpfile.js:

const { prependText, prependFile, appendText, appendFile } = require('gulp-append-prepend-no-trim');

function myAwesomeTask() {
  return src('index.html')
    .pipe(prependFile('header.html'))
    .pipe(prependText('<!-- HEADER -->'))
    .pipe(appendText('<!-- FOOTER -->'))
    .pipe(appendFile('footer.html'))
    .pipe(dest('www/'));
}

This example works with html but you can use any type of file.

Methods

  • appendFile(filepath, separator) The filepath can be an array. The separator is optional by default is "\n".
  • prependFile(filepath, separator) The filepath can be an array. The separator is optional by default is "\n".
  • appendText(text, separator) The text can be an array. The separator is optional by default is "\n".
  • prependText(text, separator) The text can be an array. The separator is optional by default is "\n".

Licence

This plugin is released under the MIT licence.

Disclaimer

Feel free to make changes in this README.

/gulp-append-prepend-no-trim/

    Package Sidebar

    Install

    npm i gulp-append-prepend-no-trim

    Weekly Downloads

    2

    Version

    1.1.0

    License

    none

    Unpacked Size

    12.1 kB

    Total Files

    11

    Last publish

    Collaborators

    • flower4war