lepi

1.0.1 • Public • Published

lepi

nodejs command line tool

Installation

$ npm install lepi -D

API

command(name, handler)

It register command in system name : string - command name handler : function( args: Array, done: function) - function to process command

  • args - list of command parameters, which was separate by spaces, first item is command name
  • done - function which has to be called once command processing is completed, if function is called with argument true, then application will be closed

log(text, color)

It print text into console text : string - text to print color : [optional] string - one of based colors: red, blue, green, yellow, magenta, ...

title(text, color)

It print nice title into console text : string - text to print color : [optional] string - one of based colors: red, blue, green, yellow, magenta, ...

Config

Here is a simple example:

const lepi = require('../index')

lepi.title('Test', 'magenta')

lepi.command('test',(args, done)=>{
  lepi.log('running http request...')
  setTimeout(()=>{
    lepi.log('completed','green')
    done()
  }, 2000)
})

Command Line

$ lepi -c ./lepiconfig.js

License

MIT

Package Sidebar

Install

npm i lepi

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.45 kB

Total Files

6

Last publish

Collaborators

  • mikhail.angelov