Skip to content

subk/vorpal-rc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vorpal-rc

Travis Codecov Commitizen friendly

.rc file support for Vorpal.js

Installation

$ npm i vorpal-rc

Usage

import Vorpal from 'vorpal';
import rc from 'vorpal-rc';

const vorpal = new Vorpal();

// first declare your commands
vorpal
  .command('hello <your-name>')
  .action(function (args, callback) {
    this.log('Hi %s !', args['your-name']);
    callback();
  });

// execute ~/.awesomerc then show command line
vorpal
  .use(rc, path.join(os.homedir(), '.awesomerc'))
  .delimiter('example>')
  .show();

Example

Quick example :

$ npm i
$ cat ~/.awesomerc
hello Vorpal
exit
$ npm run example ~/.awesomerc
Hi Vorpal !
$

License

MIT