1.3.3 • Published 4 years ago

@ajar/marker v1.3.3

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

marker marker jest jest

Marker

A simple color logging utility for your node.js console.

Marker

installation

npm i @ajar/marker

Features

  1. colored logs - by level, level shorthand or explicit colors
  2. prefix logs with file name and line number
  3. prints complex objects
  4. smart error logs -

    logs error message and stack
    ignores node_modules and node internals to focus on your own code

CommonJS

const marker = require('@ajar/marker'); 

ES6 modules

import marker from '@ajar/marker'; 

Usage

marker.info('hello','marker'); 

Examples

//by levels  

marker.verbose('verbose','is explicit');
marker.debug('debug','is common');
marker.info('info','is trivial');  
marker.warn('warn','is important');  
marker.err('err','is critical'); 

//by levels shorthand

marker.v('v','is short for verbose');    
marker.d('d','is short for debug');     
marker.i('i','is short for info');     
marker.w('w','is short for warn');     
marker.e('e','is short for err');  

//by color names

marker.blue('blue','ocean');       
marker.magenta('magenta','is lighter then purple');    
marker.cyan('cyan','is lighter then blue');       
marker.green('green','peace');      
marker.yellow('yellow','mellow');     
marker.red('red','tape');        
   
// .obj()
const complex_object = {
    one:1,
    two:2,
    internal:{
        a:'first',
        b:'second',
        nested:{
            key:'value',
            some:'thing',
            fruits:['apple','orange','banana'],
            types:[{str:'one',int:2,bool:false,empty:null}]
        }
    },
    three:3,
    four:4
}
/**
 * Use .obj() to log complex objects
 * @param { Object } obj - the Object to log 
 * @param { string } label - optional label 
 */
marker.obj(complex_object,'This is a complex_object');

/**
 * use .error() to log errors
 * @param { Error } - an Error object to log
 */
try{
    define('is not defind')
}catch(err){
    marker.error(err)
}

Example output

@infinitebrahmanuniverse/nolb-_aj@everything-registry/sub-chunk-37@kolomiytsev/timescript@xomute/timescriptiasyncpack@tsalex1992/slugger@tkariv/slugger@thy3f/slugger@tomerpool/slugger@tomertest1824/slugger@uzicohen9/slugger@vlad.siretchi/slugger@wackylau/slugger@volodymyrp/timescript@yehonathan_bar_ilan/timescript@yonatanberns/npm-slugger@yahav_sasporta/slugger@y0n1/slugger@yaelt/slugger@yairrr/promises-lib@yairrr/slugger@yair_abranyi/slugger@yythe1/2022_01_24@zalastax/nolb-_aj@yos1234/slugger@yuval1488/timescript@yuvalbarzam/fe-course-slugger@yurii_hrecheniuk/timescript@tempnodejs/slugger@zinae/slugger@dysco76/timescript@chshum/npm_stuff@azulaynaama90/slugger@gramaradu/slugger@13pycm/timescript@1liornatan/timescript@__iklotz__/slugger@abcdabcd/slugger@grinvald.alexander/slugger@guyyomtov/timepackage@guy.katchka/slugger@adam-browning/slugger@ed55555/slugger@ehyper/slugger@ajar/async@ajar/slug@ajar/slugerion@ajar/slugger-ts@ajar/slugger888@ajar/sluggerish@ajar/sluggio@ajar/sluggr@ajar/slugnation@ajar/swiss-utils2@ajar/timescript@ajar/yavetz@cocoseluldemunte/workspace@coursenode/slugger@alp2003/slugger@amaliapopescu/slugger@alexandravo/slugger@amitole/slugger@amitsrapyd/promise@amitsrapyd/slugger@shmulik010/timescriptts-swc-node-starterts-esm-starter@baddonic/timescript@bakbuk/ts-promises@barbuvlad91/slugger@bialik100/mypackages@chekayufor/slugger@ladlad/slugger@kupernik/slugger@landau07/landau@lizelkind/slagger@liavv/slugger@liberwoman/promises@liberwoman/slugger@liberwoman/ts-swc-node-starter@lirando/slugger@lironash/timescript@linoyboaron/slugger@linoyboaron/tsmodule@mpmisha/slugger2.0@narc/slugger@nadavtal/iasyncpack@nayanodejscourse/slugger@morang/slugger@puli66/slugger@sax777/slugger@sapirelmakayes/slugger@renanaarfi/promises_function@renanaarfi/slugger@rimonh/slugger@pelegstreit/slugger@penz/timescript@rombass/slugger@roeesh/promises-functions-typescript@roeesh/slugger
1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.15

7 years ago

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

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