# gulp-first

> Simple streaming object filter passes through only the first object received

Latest version **1.0.7** (published 2017-07-05) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.0.7 |
| Published | 2017-07-05 |
| First published | 2017-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Burt Harris |
| Maintainers | burt_harris |
| Keywords | gulp, gulpplugin, first, object, stream |

## Links

- npm: https://www.npmjs.com/package/gulp-first
- Repository: https://github.com/BurtHarris/gulp-first
- Homepage: https://github.com/BurtHarris/gulp-first#readme
- Issues: https://github.com/BurtHarris/gulp-first/issues
- npm.io page: https://npm.io/package/gulp-first

## Dependencies (1)

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

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2017-07-05
- 1.0.6 — 2017-07-04
- 1.0.4 — 2017-07-04
- 1.0.3 — 2017-07-04
- 1.0.2 — 2017-07-04

## README

[![npm version](https://badge.fury.io/js/gulp-first.svg)](https://badge.fury.io/js/gulp-first)
[![Build Status](https://travis-ci.org/BurtHarris/gulp-first.svg?branch=master)](https://travis-ci.org/BurtHarris/gulp-first)
[![GitHub issues](https://img.shields.io/github/issues/BurtHarris/gulp-first.svg)](https://github.com/BurtHarris/gulp-first/issues)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)


# gulp-first 
A Gulp plugin for passing through only the first object (source file) selected.

Used combination with `gulp-newer`, this filter will emit only the first file object 
if *any* of the files from a `gulp.src(...)` glob are newer than the target.  This can be useful with `gulp-exec` for many:1 build tasks where some external tool needs to be invoked if the target is out-of-date. 

    npm install -D gulp-first

## use (in a gulpfile)

```javascript
var gulp = require('gulp')
var newer = require('gulp-newer')
var first = require('gulp-first')
var exec = require('gulp-exec')

var paths = {
  src: ["pom.xml", "src/**/*", "resources/**/*", "test/**/*"],
  target: "target/antlr4-typescript-4.6-SNAPSHOT-complete.jar"
}

gulp.task('maven', function () {
  return gulp.src(paths.src, { read: false })
    .pipe(newer(paths.target))
    .pipe(first())
    .pipe(exec('mvn install -Dmaven.test.skip=true'))
    .pipe(exec.reporter())
})
```

This usage pattern will ensure that the `mvn` command is executed only once, to generate the .jar file, no matter how many source files have changed.

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