diff --git a/README.md b/README.md index 24c6184..5a91573 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ # console-ultimate - Node-compatible `console` object with extra features. Replace default one with this and you'll have nice styles and advanced features out of the box. Features include: timers, terminal clear, customizable styles and behavior for every function, on-off options for every additional function and other. -# install +All Node-related features are enabled by default and can be noop-ed if required. Any additional feature can be easily turned on and customized. + +Now all Node-related features is **implemented** and this module can be used as **drop-in** replacement for **standard console**. + + +## install ```sh npm install console-ultimate # or npm install StreetStrider/console-ultimate ``` -# usage + +## usage +### instantiate + ```javascript var Console = require('console-ultimate'); var console; @@ -22,6 +29,14 @@ console = Console(); console.log('...'); ``` + +The third parameter can be used to pass any options. +```javascript +Console(stdout, stderr, options) +``` + + +### styling `Console.colors` and any console instance `.colors` property is a ref to [cli-color](https://github.com/medikoo/cli-color). It can be used for customizing output styles. ```javascript @@ -36,7 +51,27 @@ console = Console(null, null, { console.log('...'); // output is bold now ``` -# todo + +### features +Addtional features are managed by feature-gates. +```javascript +console = Console(null, null, { + clear: true, /* enable `clear` method */ + count: true, /* enable `count` method */ + + timer: /* enable `time`, `timeEnd` */ + { + hrtime: true /* tune it to use hi-precision timer */ + } +}); +``` + +### examples +You can find feature-by-feature examples in `examples/` directory. + + +## todo +Work on features is not come to end. Many additional interesting features, such as ansi-tables and grouping will arrive. Also, tests will be required if any interest to this module occur. * features: * [x] log, info, warn, error