# gulp-changed-in-place

> Only pass through changed files

Latest version **2.3.0** (published 2017-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-changed-in-place
pnpm add gulp-changed-in-place
yarn add gulp-changed-in-place
bun add gulp-changed-in-place
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2017-09-28 |
| First published | 2015-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 56 |
| Author | Alex Gorbatchev |
| Maintainers | alexgorbatchev |
| Keywords | gulpplugin, file, files, changed, newer, modified, modification, updated, time, mtime, stat, cache, cached, passthrough |

## Links

- npm: https://www.npmjs.com/package/gulp-changed-in-place
- Repository: https://github.com/alexgorbatchev/gulp-changed-in-place
- Homepage: https://github.com/alexgorbatchev/gulp-changed-in-place#readme
- Issues: https://github.com/alexgorbatchev/gulp-changed-in-place/issues
- npm.io page: https://npm.io/package/gulp-changed-in-place

## Dependencies (1)

- [through2](https://npm.io/package/through2.md) ^2.0.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2017-09-28
- 2.2.0 — 2017-03-28
- 2.0.3 — 2015-10-31
- 2.0.2 — 2015-10-29
- 2.0.1 — 2015-10-28

## README

# gulp-changed-in-place

[![Dependency status](https://img.shields.io/david/alexgorbatchev/gulp-changed-in-place.svg?style=flat)](https://david-dm.org/alexgorbatchev/gulp-changed-in-place)
[![devDependency Status](https://img.shields.io/david/dev/alexgorbatchev/gulp-changed-in-place.svg?style=flat)](https://david-dm.org/alexgorbatchev/gulp-changed-in-place#info=devDependencies)
[![Build Status](https://img.shields.io/travis/alexgorbatchev/gulp-changed-in-place.svg?style=flat&branch=master)](https://travis-ci.org/alexgorbatchev/gulp-changed-in-place)

> Only pass through changed files

No more wasting precious time on processing unchanged files.

By default it's only able to detect whether files in the stream changed. If you require something more advanced like knowing if imports/dependencies changed, create a custom comparator, or use [another plugin](https://github.com/gulpjs/gulp#incremental-builds).

How is this different from [gulp-changed](https://github.com/sindresorhus/gulp-changed)? `gulp-changed` checks against build files, for example ES5 files generated by Babel.js from the source ES6 files. `gulp-changed-in-place` monitors source files, ES6 files in this example. This allows you to do things like apply source formatting or linting only to changed files while you are working on them.

## Install

```
$ npm install --save-dev gulp-changed-in-place
```

## Usage

```js
var gulp = require('gulp');
var changedInPlace = require('gulp-changed-in-place');
var tsfmt = require('gulp-tsfmt');

gulp.task('default', function () {
  return gulp.src('src/**/*.{ts,tsx}')
    .pipe(changedInPlace())
    .pipe(tsfmt())
    .pipe(gulp.dest('src'));
});
```

## API

### changed(options)

#### `firstPass`
* `boolean`
* Default = `false`

  Makes `gulp-changed-in-place` pass through all files once on the first run.

#### `cache`
* `Object`
* Default = `{}`

  Object of `{ key: value }` format for all the files that is shared between all runs. Value will be hash or modification time, depending on the `howToDetermineDifference` option.

#### `howToDetermineDifference`
* `"hash" || "modification-time"`
* Default = `hash`

  Selects how it is determined if a file has been changed.

  * `hash`: Change will be triggered when SHA1 sum of the file content changes. This is a slower but more correct way.
  * `modification-time`: Change will be triggered based on the modification time stamp (mtime) of the file.

```js
.pipe(changedInPlace({ howToDetermineDifference: "modification-time" }))
```

#### `basePath`
* `string`
* Default = `undefined`

  Allows you to set relative path that will be used for storing paths in the `cache`.

# Version History

[Change log](changelog.md)

# License

The MIT License (MIT)

Copyright (c) 2015 Alex Gorbatchev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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