gulp-autocomplete-prompt v0.1.0
gulp-autocomplete-prompt

Autocomplete prompt for choosing a file to write.
Install
Install with npm:
$ npm install --save gulp-autocomplete-promptUsage
var autocomplete = require('gulp-autocomplete-prompt');
gulp.src('*.js')
.pipe(autocomplete())
.pipe(dest('dist/'));Example
This is used in generate-gitignore if you want to see a live example.
app.task('gitignore-global', function() {
return app.src('templates/*.gitignore', { cwd: __dirname })
.pipe(autocomplete({key: 'stem', basename: '.gitignore'}))
.pipe(app.dest(app.cwd));
});Options
key
Type: String
Default: relative
The vinyl file path property to use when displaying the list of files in the terminal.
Example
autocomplete({key: 'stem'})choice
Type: String
Default: undefined
Programmatically choose the file to render to avoid prompts. The provide name should match the file property based on the specified key.
Example
autocomplete({choice: 'foo'})skip
Type: Boolean
Default: undefined
Skip a file from being displayed in the list of choices.
Example
autocomplete({skip: 'foo'})
// or in another plugin
through.obj(function(file, enc, next) {
if (file.stem === 'foo') file.skip = true;
next(null, file);
});rename
Type: Object
Default: undefined
Rename the destination file using the string values on options.rename. If you need something more sophisticated there are other gulp plugins dedicated to this.
Example
autocomplete({skip: 'foo', rename: '.gitignore'})Filter
Type: Function
Default:
function filter(str, name) {
return new RegExp(str, 'i').test(name);
}Description
Filter function that takes the current search string, top search result, and array of file names as arguments.
Example
autocomplete({
filter: function(str, name) {
return new RegExp(str, 'i').test(name);
}
});About
Related projects
- gulp-choose-file: Gulp plugin that prompts you to choose a file to pass through the stream. | homepage
- gulp-choose-files: Gulp plugin that prompts you to choose the files to pass through the stream. | homepage
- gulp-dry: Gulp plugin for Dry, a new template engine with advanced inheritance features. | homepage
- gulp-htmlmin: gulp plugin to minify HTML. | homepage
- gulp-is-binary: Adds an
.isBinary()function to thefileobject, similar tofile.isNull()andfile.isStream(). | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verbRunning tests
Install dev dependencies:
$ npm install -d && npm testAuthor
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.1.30, on August 11, 2016.
9 years ago