# gulp-change

> allow file content manipulations

Latest version **1.0.2** (published 2018-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-change
pnpm add gulp-change
yarn add gulp-change
bun add gulp-change
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-12-01 |
| First published | 2014-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-change) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | PoliteJS |
| Maintainers | marcopeg |
| Keywords | gulp, change, file, content, modify, static, analysis |

## Links

- npm: https://www.npmjs.com/package/gulp-change
- Repository: https://github.com/PoliteJS/gulp-change
- Issues: https://github.com/PoliteJS/gulp-change/issues
- npm.io page: https://npm.io/package/gulp-change

## Dependencies (1)

- [event-stream](https://npm.io/package/event-stream.md) ^4.0.1

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-12-01
- 1.0.1 — 2018-12-01
- 1.0.0 — 2014-10-25

## README

gulp-change
===========

File content change utility for [GulpJS](http://gulpjs.com/).  

> 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

---
_Source: https://npm.io/package/gulp-change · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
