# gulp-choose-files

> Gulp plugin that prompts you to choose the files to pass through the stream.

Latest version **2.0.0** (published 2019-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-choose-files
pnpm add gulp-choose-files
yarn add gulp-choose-files
bun add gulp-choose-files
```

## 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.0.0 |
| Published | 2019-04-07 |
| First published | 2016-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | ask, choose, conditional, files, fs, gulp, gulpplugin, pick, plugin, prompt, question, render, write |

## Links

- npm: https://www.npmjs.com/package/gulp-choose-files
- Repository: https://github.com/generate/gulp-choose-files
- Issues: https://github.com/generate/gulp-choose-files/issues
- npm.io page: https://npm.io/package/gulp-choose-files

## Dependencies (2)

- [enquirer](https://npm.io/package/enquirer.md) ^2.3.0
- [through2](https://npm.io/package/through2.md) ^3.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

- 2.0.0 (latest) — 2019-04-07
- 1.0.0 — 2017-04-29
- 0.1.3 — 2016-07-16
- 0.1.2 — 2016-06-15
- 0.1.1 — 2016-06-09
- 0.1.0 — 2016-05-19

## README

# gulp-choose-files [![NPM version](https://img.shields.io/npm/v/gulp-choose-files.svg?style=flat)](https://www.npmjs.com/package/gulp-choose-files) [![NPM monthly downloads](https://img.shields.io/npm/dm/gulp-choose-files.svg?style=flat)](https://npmjs.org/package/gulp-choose-files) [![NPM total downloads](https://img.shields.io/npm/dt/gulp-choose-files.svg?style=flat)](https://npmjs.org/package/gulp-choose-files)

> Gulp plugin that prompts you to choose the files to pass through the stream.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save gulp-choose-files
```

Install with [yarn](https://yarnpkg.com):

```sh
$ yarn add gulp-choose-files
```

![gulp choose files example](example.gif)

## Usage

```js
var gulp = require('gulp');
var choose = require('gulp-choose-files');

gulp.task('default', function() {
  return gulp.src('fixtures/*.*')
    .pipe(choose())
    .pipe(gulp.dest('actual'));
});
```

## options.key

**Type**: `string`

**Default**: `relative`

Specify the [vinyl](https://github.com/gulpjs/vinyl) `file` property to use when displaying file names in the choices array.

**Examples**

Given the file path `/dev/fixtures/foo.txt` (depending on cwd and `file.base`), here is what you would get:

```js
choose({key: 'path'});
//=> '/dev/fixtures/foo.txt'
choose({key: 'relative'});
//=> 'fixtures/foo.txt'
choose({key: 'basename'});
//=> 'foo.txt'
choose({key: 'stem'});
//=> 'foo'
```

## options.choices

If you need to be able to automatically skip the prompt, you can pass a string or array with your "choices" to `options.choices`.

The following will only write `a.txt`:

```js
gulp.task('default', function() {
  return gulp.src('fixtures/*.txt')
    .pipe(choose({choices: ['a.txt']}))
    .pipe(gulp.dest('actual'));
});
```

## About

### Related projects

* [gulp-choose-file](https://www.npmjs.com/package/gulp-choose-file): Gulp plugin that prompts you to choose a file to pass through the stream. | [homepage](https://github.com/pointnet/gulp-choose-file "Gulp plugin that prompts you to choose a file to pass through the stream.")
* [gulp-condense](https://www.npmjs.com/package/gulp-condense): Remove extra newlines in a string. | [homepage](https://github.com/jonschlinkert/gulp-condense "Remove extra newlines in a string.")
* [gulp-extname](https://www.npmjs.com/package/gulp-extname): gulp plugin to dynamically rewrite dest extensions based on src extensions. | [homepage](https://github.com/jonschlinkert/gulp-extname "gulp plugin to dynamically rewrite dest extensions based on src extensions.")
* [gulp-htmlmin](https://www.npmjs.com/package/gulp-htmlmin): gulp plugin to minify HTML. | [homepage](https://github.com/jonschlinkert/gulp-htmlmin#readme "gulp plugin to minify HTML.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 28, 2017._

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