1.0.2 • Published 8 years ago

soo-logger v1.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
8 years ago

soo-logger

Screw Object, Object

I hate trying to debug with the console and only seeing partial data, with the rest falling into Object blocks. This is an attempt to fix that.

soo-logger turns this:

{ dog:
   { name: 'kylo',
     breeds: [ [Object], [Object] ],
     siblings: [ [Object] ] } }

into this:

{
  "dog": {
    "name": "kylo",
    "breeds": [
      {
        "breed": "Lab"
      },
      {
        "breed": "Pit Bull"
      }
    ],
    "siblings": [
      {
        "name": "Leia",
        "breeds": [
          {
            "breed": "Border Collie"
          }
        ]
      }
    ]
  }
}

Usage:

$ yarn add soo-logger
const soo = require('soo-logger');

const data = {
  dog: {
    name: 'kylo',
    breeds: [
      {
        breed: 'Lab',
      },
      {
        breed: 'Pit Bull',
      },
      {
        breed: 'Doofus',
      },
    ],
  },
};

console.log(data) // => Prints garbage.
soo(data); // => Prints what you would expect.
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago