vorpal-autocomplete-fs

0.0.3 • Public • Published

Vorpal - File System Autocompletion

Build Status Coverage Status XO code style

An extension to Vorpal that provides File System-based tabbed autocompletion for a given command. This is an exact match of the autocomplete functionality provided in Unix commands like ls or cat.

Installation

npm install vorpal-autocomplete-fs
npm install vorpal

Getting Started

const vorpal = require('vorpal')();
const fsAutocomplete = require('vorpal-autocomplete-fs');
 
vorpal.delimiter('myapp$').show();
 
vorpal
  .command('cat [dirs...]')
  .autocomplete(fsAutocomplete());
$ node myapp.js
myapp$ cat [tab] [tab]
bin/  myapp.js  package.json  README.md
myapp~$ cat m [tab]
myapp~$ cat myapp.js
 

Only show directories

To omit files from the autocomplete and only show directories, pass in the directory option:

vorpal
  .command('cat [dirs...]')
  .autocomplete(fsAutocomplete({directory: true}));

License

MIT © David Caccavella

Package Sidebar

Install

npm i vorpal-autocomplete-fs

Weekly Downloads

835

Version

0.0.3

License

MIT

Last publish

Collaborators

  • dthree