1.5.3 • Published 7 years ago

lme v1.5.3

Weekly downloads
77
License
MIT
Repository
github
Last release
7 years ago

lme

Simply and beautifully log to console.

Build Status Known Vulnerabilities npm npm Gitter chat

npm.io

console.log ging done right, beautifully.

You don't have to write the 13 char long console.log() anymore. Try:

lme.d("hello world");

:dizzy: This package is built from ground up with simplicity in mind. Best configuration ships with this package. i.e, You don't have to configure anything extra to start using this package. But if you need something unique, or if color of your terminal background contradicts with this package's colors (causing accessibility issues), or if you are a kind of unicorn, you have wonderful options to adjust them here. And this package is bound to strictly follow semantic versioning.

v1.5 is out. What's new? - Set environment variable to adjust level of logging. - Define your own color schemes for lines - Define your own color schemes for texts - Multiple argumnets support: lme.s("hi", "hello") - Stability, performance improvements and Bug fixes.

Why lme ( logme )

Greenkeeper badge

npm.io npm.io npm.io

Install / Update

npm install --save lme

Usage

Syntax

lme.<status>(message);

Example

const lme = require('lme');

lme.d("my kitty is pinky!"); // default style, used for anonymous outputs.
lme.e("Snap! something went wrong."); // used for logging errors.
lme.s("Oh yeah!"); // used for logging success.
lme.w("Attention! Thank you for your attention."); // used for logging warnings.

// lines
lme.line() // used to draw lines
lme.eline() // used to draw lines in error theme.
lme.sline() // used to draw lines in success theme.

APIs

Syntax : lme.<status>(message);

  • where <status> can have the following values:
statusnamewhen to useexample
ddefaultdefault outputlme.d("hi");
ssuccesson success outputlme.s("hi");
eerroron error-ed outputlme.e("hi");
wwarningfor warnings like outputlme.w("hi");
hhighlightfor highlighting an outputlme.h("hi");
iinfofor info like outputlme.i("hi");
ttracefor tracing stacklme.t("hi");

where message can be string / float / int / objects. (note that javascript treats arrays as objects.)

You can also use multiple arguments with lme like:

lme.d(message[, message]);

Drawing lines with lme.line()

Syntax : lme.line(character, length). (both arguments are optional)

You can prefix d, s, e, w, h to the line() function to obtain the corresponding color scheme for your line. You can also simply use lme.line() which has some default values as described below.

Argument List

argumenttypepurposedefault value
characterstringdetermines which character should be used for drawing lines-
lengthintegerlength of the line30

Examples

lme.line();
lme.eline("^");
lme.sline("@", 12);
lme.wline("#", 50);

APIs for drawing lines

statusnamewhen to useexample
linedefaultdefault outputlme.line();
dlinesame as linedefault outputlme.dline("*", 5);
slinesuccesson success outputlme.sline("*");
elineerroron error-ed outputlme.eline("/", 50);
wlinewarningfor warnings like outputlme.wline("*");
hlinehighlightfor highlighting an outputlme.hline("*");

Advanced fearures

Wiki More configurations are on its way.

If you wish to file any feature/bugs, mention it on issues.

Enjoy.

Thanks

Thanks to everyone who contributed to this project by means of providing feedback, rising issues, opening pull requests and reviewing codes. Thanks for using lme.

Contributors

Loves lme? :heart:

tell your friends.. :two_men_holding_hands: star this project on Github :star:

Change log

  • v1.5.2, 1.5.3 (8th June 2017)
    • Adds extra badges, docs update. - Gitter chat
  • v1.5.1 (27th March 2017)
    • IMPORTANT bug fix: addressing issue with displaying instances of Error class. (#30). (Highly recommended to update to this version)
  • v1.5.0 (6th March 2017)
  • v1.4.1, v1.4.2
    • Patch: Excluding an unnecessary folder -> reduces package size.
    • Updating docs and media.
  • v1.4.0 (26th Jan 2017)
    • Added support for custom color configuration.
    • Added support for multiple arguments. (thanks @demacdonald)
    • Stability and performance improvements.

See detailed change log

License

MIT © Vajahath Ahmed

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago