Socket
Book a DemoInstallSign in
Socket

gulp-autocomplete-prompt

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-autocomplete-prompt

Autocomplete prompt for choosing a file to write.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

gulp-autocomplete-prompt NPM version NPM downloads

Autocomplete prompt for choosing a file to write.

Install

Install with npm:

$ npm install --save gulp-autocomplete-prompt

Usage

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

  • 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 the file object, similar to file.isNull() and file.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 && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

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.

Keywords

autocomplete

FAQs

Package last updated on 12 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts