teselecta

JSON.stringify with colors

Usage no npm install needed!

<script type="module">
  import teselecta from 'https://cdn.skypack.dev/teselecta';
</script>

README

teselecta

JSON.stringify with colors

Screenshot

Usage:

var teselecta=require('teselecta'), text;

text=teselecta({
  wibbly:'wobbly',
  stuff:['timey', 'wimey'],
  releaseYear:1963,
  tardis:{
    type:'Space-time vessel',
    chameleonCircuit:{broken:true, works:false},
  }
});

console.log(text);

Change the default colors:

teselecta.QUOTATION='grey';
teselecta.KEY='blue';
teselecta.STRING='cyan';
teselecta.NUMBER='magenta';
teselecta.TRUE='green';
teselecta.FALSE='red';

Tests

Run tests with npm test or generate coverage reports with npm run test-cov.

License

MIT