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@gramaradu/slugger@grinvald.alexander/slugger@guyyomtov/timepackage@guy.katchka/slugger@shmulik010/timescriptts-swc-node-starterts-esm-starter@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/tsmodulemy_bluebirdslugger3@oana.popescu/slugger@obit91/sluggerify@orenkes/slugger@omriazr/promises@omriazr/slugger@omriazr/ts-swc-node-starter@giladrozmarin/slugger@gideonsh/promises@gideonsh/slugger@hezibe/slugger@nikitasd/timescript@nitzanwagner/slugger@noamshneor/promise-lib@noamshneor/slugger@feldum/npm@frogety/slagger@idaamit/slugger@gabriela993/slugger@gal-barkan/npm-tutorial@gal-barkan/promises-package@galg/slug@galbazadka/workspace@pelegstreit/slugger@penz/timescript@orschweitzer/promises@orschweitzer/slugger@ortalz/bluebird@ortalz/slugger@shlomiaz/slugger@shirbh/slugger@shirbh/slugger2@shirni/slugger@shmush/slugger@talso/slugger@tairp/slugger@talaharon/promises-async-reimplementation@talaviad5/timescript@tamir-nakar/slugger@tamirshina/slugger@13pycm/timescript@1liornatan/timescript@__iklotz__/slugger@abcdabcd/slugger@puli66/slugger@chekayufor/slugger@chshum/npm_stuff@bialik100/mypackages@azulaynaama90/slugger@baddonic/timescript
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