Skip to content
/ giveit Public

Debug by logging with ease any nested objects, arrays, etc. JSON.stringify wrapper to display nested objects with indentation & color for quick debugging

License

Notifications You must be signed in to change notification settings

pH-7/giveit

Repository files navigation

giveit

Debug with ease any nested objects, arrays, etc. giveit (AKA "Give It To Me") is a lightweight JSON.stringify wrapper to display nested objects with indentation and color for quick debugging.

Installation

Using NPM

npm i giveit

Using Yarn

yarn add giveit

Usage

import { giveit } from "giveit";

const arrObj = [
  {
    name: "John Doe",
    age: 30,
    city: "New York",
    hobbies: ["reading", "cooking"],
    married: false,
    address: {
      street: "123 Main St",
      zip: 12345,
    },
  },
];

// give it! giveit() will nicely show arrObj
console.log("See nested values of arrObj", giveit(arrObj));

Example of showing nested objects

Author

Pierre-Henry Soria

Pierre-Henry Soria ツ – A super passionate and enthusiastic Problem-Solver / Senior Software Data Engineer living currently in Sydney. Also, a true cheese 🧀, ristretto ☕️, and dark chocolate lover! 😋 👉 Reach me on LinkedIn ⚡️

License

Distributed under the MIT 🎉 Enjoy!