Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-change

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-change

allow file content manipulations

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-change

File content change utility for GulpJS.

Allow to easily alter the content of a Gulp files stream with a sync/async callback

npm install gulp-change

Sync Usage

var gulp = require('gulp');
var change = require('change');

function performChange(content) {
    return content.replace(/foo/g, 'FOO');
}

gulp.task('change', function() {
    return gulp.src('src/*.html')
        .pipe(change(performChange))
        .pipe(gulp.dest('build/'))
});

Async Usage

var gulp = require('gulp');
var change = require('change');

function performChange(content, done) {
    content.replace(/foo/g, 'FOO');
    done(null, content);
}

gulp.task('change', function() {
    return gulp.src('src/*.html')
        .pipe(change(performChange))
        .pipe(gulp.dest('build/'))
});

Callback Context

The callback receive a custom context (this) populated with:

file

original file object from Gulp' stream

fname

file name

originalContent

original file content

Keywords

FAQs

Package last updated on 25 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc