https://github.com/generate/gulp-choose-files
Gulp plugin that prompts you to choose the files pass through the stream.
https://github.com/generate/gulp-choose-files
Last synced: about 1 year ago
JSON representation
Gulp plugin that prompts you to choose the files pass through the stream.
- Host: GitHub
- URL: https://github.com/generate/gulp-choose-files
- Owner: generate
- License: mit
- Created: 2016-05-19T20:57:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-29T01:30:04.000Z (about 9 years ago)
- Last Synced: 2025-04-11T22:18:33.638Z (about 1 year ago)
- Language: JavaScript
- Size: 821 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-choose-files [](https://www.npmjs.com/package/gulp-choose-files) [](https://npmjs.org/package/gulp-choose-files) [](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
```

## 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._