New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-formatter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-formatter

A JSON to HTML formatter for use with AMD/Non-AMD

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
122
22%
Maintainers
1
Weekly downloads
 
Created
Source

JSON -> HTML Formatter

A JSON to HTML formatter for use with AMD/Non-AMD

Convert basic JSON datatypes (number, string, boolean, null, object, array) into an HTML fragments.

Code Extracted and modified to be a more reusable following the (Universal Module Definition) pattern.

Based On Firefox/Chrome Extension's :

  • Ben Hollis @bhollis (Firefox Extension - http://jsonview.com/)
  • Jamie Wilkinson @jamiew (Chrome Port - https://github.com/jamiew/jsonview-chrome)

Usage

new JSONFormatter(options).toHtml(json);

Supported options - number - string - boolean - object - array

Example options override

   var formatterOptions = {
          'string' : function(key,val) {
            if (key === 'id') return '<a class="link" data-request="'+val+'">'+val+'</a>';
            return false;
          }
        };

License

MIT/BSD

FAQs

Package last updated on 09 Sep 2013

Did you know?

Socket

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