Socket
Socket
Sign inDemoInstall

json-format-highlight

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    json-format-highlight

Format json and highlight it as well.


Version published
Maintainers
1
Created

Readme

Source

json-format-highlight

NPM version NPM downloads CircleCI

DEMO

Edit luyilin/json-format-highlight: codesandbox

Snapshot

Introduction

Format json and highlight it as well.

A really tiny package, only 652 bytes.

Install

yarn add json-format-highlight --save

CDN: UNPKG | jsDelivr

Usage

import formatHighlight from 'json-format-highlight'

formatHighlight(json, colorOptions)

Option

colorOptions

Type: object
Default: {}

Define your exclusive color scheme :D

You can set the key and types of value of the json to custom colors.

OptionTypeDefaultDesc
keyColorstringdimgrayKey color
numberColorstringlightskyblueColor of the value of the number type
stringColorstringlightcoralColor of the value of the string type
trueColorstringlightseagreenColor of the value of the boolean type and equals to true
falseColorstring#f66578Color of the value of the string type and equals to false
nullColorstringcornflowerblueColor of the value of the null type

License

MIT © luyilin

minemine.cc · GitHub @luyilin · Twitter @luyilin12

FAQs

Last updated on 12 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc