No-problem CLI library written in ES6
No-problem CLI library written in ES6.
This is yet another CLI utility library for Node but with the added twist of being written in ECMAScript 6 syntax to the extent supported by traceur from @google.
If you just want to use the library you do not have to install the traceur compiler. The published module is pre-compiled to ECMAScript 5 compatible code.
Simply install using npm in the root of your project folder, like any other module:
$ npm i np-cli --save
If you want to poke around in the code and see what happens, you currently need to manually recompile in order to test your changes. A rudimentary build-script is included in the source repository.
Docs...
var cursor = new cli.Cursor();
cursor
.bold()
.bg.hex('#f00')
.write('horrible')
.reset();
Also docs...
var cursor = new cli.Cursor({stream:null});
var prefix = cursor
.buffer()
.bold()
.bg.hex('#f00')
.write('horrible')
.reset()
.flush();
console.log('%s hello', prefix);