An update for the browser console - https://neacodin.github.io/keensole/
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
source
.babelrc
.eslintrc
.gitignore
CONTRIBUTING.md
LICENSE.md
README.md
bower.json
gulpfile.js
index.js
package.json
screenshot.png

README.md

Keensole

Browser Support Status

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!

Alt text

Let's see how

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

Prerequisites

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 😄

Installing

You can install this package either with npm or with bower.

npm

npm install keensole --save

Then add a <script> to your index.html:

<script src="/node_modules/keensole/dist/keensole.js"></script>

bower

bower install keensole --save

Then add a <script> to your index.html:

<script src="/bower_components/keensole/dist/keensole.js"></script>

Available Helper Functions

Available functions are splited into four different categories.

Colors

Name Function
red Changes the text color to red
green Changes the text color to green
yellow Changes the text color to yellow

Themes

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

Typography

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

Functions

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

Contributing

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.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details