npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-json-viewer-ext

v3.2.3

Published

JSON formatter / viewer for Angular

Downloads

2

Readme

ngx-json-viewer

JSON formatter and viewer for Angular

Live demo:

  • Angular 14: https://stackblitz.com/edit/angular-14-ngx-json-viewer
  • Angular 5: https://stackblitz.com/edit/ngx-json-viewer

Install

npm install ngx-json-viewer

or

yarn add ngx-json-viewer

For older Angular:

# For Angular 4/5/6/7+:
npm install ngx-json-viewer@2

# For Angular 2:
npm install ngx-json-viewer@1

NPM Package: https://www.npmjs.com/package/ngx-json-viewer

Usage

In your app.module.ts import NgxJsonViewerModule like

import { NgxJsonViewerModule } from 'ngx-json-viewer';

@NgModule({
  ...,
  imports: [
    ...,
    NgxJsonViewerModule,
    ...
  ],
  ...
})
export class AppModule { }

In your component:

<ngx-json-viewer [json]="someObject"></ngx-json-viewer>

To collapse all nodes at first:

<ngx-json-viewer [json]="someObject" [expanded]="false"></ngx-json-viewer>

To only expand 3 levels:

<ngx-json-viewer [json]="someObject" [depth]="3"></ngx-json-viewer>

Theming

Theming can be done with CSS variables

  • --ngx-json-string : color of string values
  • --ngx-json-number : color of number values
  • --ngx-json-boolean : color of boolean values
  • --ngx-json-date : color of date values
  • --ngx-json-array : color of array values
  • --ngx-json-object : color of object values
  • --ngx-json-function : color of function values
  • --ngx-json-null : color of null values
  • --ngx-json-null-bg : background color of null values
  • --ngx-json-undefined : color of undefined values
  • --ngx-json-toggler : color of toggler
  • --ngx-json-key : color of keys
  • --ngx-json-separator : color of separators
  • --ngx-json-value : color of values
  • --ngx-json-undefined-key : color for key of undefined values
  • --ngx-json-font-family : font-family
  • --ngx-json-font-size : font-size