Coder Social home page Coder Social logo

logcl's Introduction

logcl

A simple node package with a set of wrapper functions to console.log()

  • cl - console.log or new line
  • clt - console.log title
  • cli - console.log indent (2 spaces)
  • cll - console.log with label and data. data is indented 2 spaces
  • cld - console.log with dashes before and after label

Install

$ npm install logcl --save

Use

Create a reference to the module in code. Then invoke the methods as needed.

code:

var log = require('logcl');

var foo = "foo";
var bar = "bar";

log.cl('test1');
log.cl();

log.clt('My Title');
log.cli('data');
log.cl();

log.cld('next test');
log.cll(foo, bar);

output:

$ test1
$
$ My Title
$   data
$
$ ---------- next test
$ foo
$   bar

Examples

cl - console.log or new line

code:

var data = 'hello world';
log.cl();
log.cl(data);

output:

// output
$
$ hello world

clt - console.log with title
cli - console.log with 2 space indent

code:

var title = 'An Object';
var data = { name: 'my object' };

log.clt(title);
log.cli(data);

output:

$ An Object
$   { name: 'my object' }

cld - console.log with with dashes before label
cll - console.log with label and data. data is indented 2 spaces

code:

var section = "New Section";
var myNum = 42;
var myArr = [1,2,3];

log.cld(section)
log.cll("Number", myNum);
log.cll("Array", myArr);

output:

$ ---------- New Section
$ Number
$   42
$ Array
$   [1, 2, 3]

logcl's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.