GithubHelp home page GithubHelp logo

inspc's Introduction

npm version NpmLicense

DEPRECATED

Created in 2018 - quite old now and not maintained

logi

This function use native util.inspect

Node.js mode with browser fallback to logw

const log = require('inspc/logi');

log.colors(true);

log({data: 'string', fn: () => {}});
log({data: 'string', fn: () => {}}, 2, false); // def: 2, false

log.dump

In many cases faster implementation

Node.js mode with browser fallback to logw

const log = require('inspc/logn');
// const logn = require('inspc/logn').dump;

log.dump({data: 'string', fn: () => {}})    
log.dump({data: 'string', fn: () => {}}, 2) // def: 2   

logt

Just fallback to console.log but with timestamp

const logt = require('inspc/logt');

or:

const log = require('inspc');

cosnt logt = log.t;

logw

Just always safe version of console.log with no timestamp

const logw = require('inspc/logw');  

grabbing output to string variable

log.start();

log.dump('test1');

log('test2');

// true or false to additionally flush data to screen after return (def false)
const tmp = log.get(true);

require all

const log = require('inspc');

const data = {
    one: 'two',
    three: true,
    four: () => {},
    a: ['str', null, undefined, 2, 'end', {obj:'val'}]
};

data.z = {raz: {dwa: {trzy: {cztery:  'piec'}}}};
log.dump(data, 3)
log.i(data, 3)
log.json(data)
log.i(data, 1, true) // colors on

will print:

image

addidional tools

require('inspc/isObject')
require('inspc/isArray')

const node = require('inspc/isNode');

require('inspc/getUserAgent')

const isGoogleChrome = require('inspc/isGoogleChrome')

const userAgent = (function () {try {return staticContext.req.headers['user-agent']}catch(e){}}());

isGoogleChrome(userAgent) 

extra

There is additional synchronouse method process._rawDebug that print directly to terminal

inspc's People

Contributors

stopsopa avatar grytysek avatar

Watchers

James Cloos avatar  avatar  avatar

inspc's Issues

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.