It does a very simple thing, extends console.log functionality in a funny way. It adds a few helper functions to make your message interesting!
It follows a very simple instruction. Just chain as many functions as you need to get to your desire output. For instance if I want to show there is something wrong in a piece of code I will follow below command.
keensole.error().log('Oops, something went wrong!');Or in case of showing a successful message in upper case, following command is a choice.
keensole.success().upper().log('Great, it works like a charm!');You see, you should start with keensole and end with log with a message as the parameter passed to it. Between these, you are free to use as many helper function as required.
For a list of available functions see the table below
It is a dependency free library. It means you don't need to include libraries like jquery or underscore to make it work. But we don't promise that it continues like this 😄
You can install this package either with npm or with bower.
npm install keensole --saveThen add a <script> to your index.html:
<script src="/node_modules/keensole/dist/keensole.js"></script>bower install keensole --saveThen add a <script> to your index.html:
<script src="/bower_components/keensole/dist/keensole.js"></script>Available functions are splited into four different categories.
| Name | Function |
|---|---|
| red | Changes the text color to red |
| green | Changes the text color to green |
| yellow | Changes the text color to yellow |
| Name | Function |
|---|---|
| error | An error theme with a white foreground color and a red background color |
| success | A success theme with a white foreground color and a green background color |
| warning | A warning theme with a black foreground color and an orange background color |
| info | An info theme with a black foreground color and a gray background color |
| Name | Function |
|---|---|
| underline | Underlines the message |
| lineThrough | Adds a line throughout the given message |
| overline | Overlines the message |
| small | Changes font size of the given message to small which is 10px |
| medium | Changes font size of the given message to medium which is 14px |
| large | Changes font size of the given message to medium which is 18px |
| bold | Makes the given message bold |
| italic | Makes the given message italic |
| Name | Function |
|---|---|
| reverse | Reverses the given message |
| lower | Makes all letters of a message lower case |
| upper | Makes all letters of a message upper case |
We really appreciate any contributation to make it more useful. As a collaborator once you clone the repository you need to run npm install to install required development dependencies.
Since we are using EcmaScript 6 (the great ES6😍), we use babel to translate it to ES5. So you need to run a very simple gulp task called build each time you change the source and you want to see your changes. Just run gulp build.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Sina Sadrzadeh - Github Profile
- Masoud Mirzaei - Github Profile
See also the list of contributors who participated in this project.
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details
