Writing JavaScript in the Node.js environment has always felt a bit more difficult; probably because browser developer tools have become incredibly powerful, interactive, and visually appealing.  Using .log on the client side isn’t the best of experiences and obviously isn’t interactive.


Though not interactive, I’ve found that console-probe is an improvement over console.log, providing me highlighted property types, lengths, and a nice visual tree view.


const probe = require('console-probe')

const donut = {
  'id': '0001',
  'type': 'donut',
  'name': 'Cake',
  'description': 'A small fried cake of sweetened dough, typically in the shape of a ball or ring.',
  'ppu': 0.5,
  'common': true,
  'batters':
  {
    'batter':
    [
      { 'id': '01', 'type': 'Regular' },
      { 'id': '02', 'type': 'Chocolate' },
      { 'id': '03', 'type': 'Blueberry' },
      { 'id': '04', 'type': "Devil's Food" }
    ]
  },
  // .....


// Highlight nicely to console
const prober = probe.get()
prober(donut)


console-probe is one of those nice, luxury utilities that can make debugging in a static environment just a bit better!


  • Facebook Open Graph META Tags

    It’s no secret that Facebook has become a major traffic driver for all types of .  Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate directly.  And of course there are Facebook “Like” and “Recommend” widgets on every website.  One…

  • CSS @supports

    Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn’t been available within CSS.  What we end up doing is repeating the same properties multiple times with each browser prefix.  Yuck.  Another thing we…

  • WebSocket and Socket.IO

    My favorite web technology is quickly becoming the WebSocket API. WebSocket provides a welcomed alternative to the AJAX technologies we’ve been making use of over the past few years. This new API provides a method to push messages from client to server efficiently…

  • CSS Rounded Corners

    The ability to create rounded corners with CSS opens the possibility of subtle design improvements without the need to include images.  CSS rounded corners thus save us time in creating images and requests to the server.  Today, rounded corners with CSS are supported by all of…



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here