All Projects → ftonato → svelte-debugger

ftonato / svelte-debugger

Licence: MIT License
A JSON <Debugger> component for Svelte apps

Programming Languages

Svelte
593 projects
javascript
184084 projects - #8 most used programming language

svelte-debugger (demo 🚀)

npm bundle size license

A JSON debugger component for Svelte apps.

Svelte Debugger

Installation

Install with npm:

npm install svelte-debugger --save

install with yarn:

yarn add svelte-debugger

Usage

<script>
  import Debugger from 'svelte-debugger';

  // This variable is used for the example below
  const example = {
    "id": 1,
    "name": "Leanne Graham",
      "address": {
        "street": "Kulas Light",
        "zipcode": 92998,
        "timezone": null
      },
      "company": {
        "name": "Romaguera-Crona",
        "registered": false,
        "daylightSaving": true,
      }
    };
</script>

<Debugger data={example} />

Properties

<Debugger
  data={example}
  indent={2}
  colorOptions={{ falseColor: '#ff3e00', trueColor: '#40b3ff' }}
/>

Parameters

The following parameters are available:

parameter default description
data {} The non-formated object to format
indent 2 The size number of spaces between keys and values
colorOptions {} An object that describes the individual color of each property (keyColor, numberColor, stringColor, trueColor, falseColor, nullColor) from our data object

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].