Network Performance Monitor
    Wondering what’s next for npm?Check out our public roadmap! »

    gulp-deleted

    1.0.0 • Public • Published

    gulp-deleted

    gulp-deleted allows you to remove files from the destination folder which do not exist in the source stream. You can specify a globs with which to identify destination files that are eligible for deletion, including exlusions.

    Remove any files from the destination that are no longer in source.

    function assets() {
      const src = 'src/assets/**/*';
      const dest = 'dest/';
      gulp.src(src)
        .pipe(deleted({ src, dest, patterns: [ '**/*' ] }))
        .pipe(gulp.dest(destPath));
    }

    Keep index.html in the destination even if it doesn’t exist in the source.

    function assets() {
      const src = 'src/assets/**/*';
      const dest = 'dest/';
      gulp.src(src)
        .pipe(deleted({
          src,
          dest,
          patterns: [
            '**/*',
            '!index.html',
          ],
        }))
        .pipe(gulp.dest(destPath));
    }

    Install

    npm i gulp-deleted

    DownloadsWeekly Downloads

    56

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    9.84 kB

    Total Files

    11

    Last publish

    Collaborators

    • avatar