Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fmt-obj

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fmt-obj

Prettifies any javascript object in your console

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-4.79%
Maintainers
1
Weekly downloads
 
Created
Source

fmt-obj NPM version Dependency Status License Js Standard Style

Prettifies any javascript object in your console. Make it look awesome! :lipstick:

Screenshot

View Example

Installation

npm install --save fmt-obj

Or even better

yarn add fmt-obj

Import and Usage Example

const format = require('fmt-obj')

console.log(format({
  message: 'hello world',
  dev: true,
  awesomeness: 9.99,
  body: {
    these: null,
    are: 'string',
    some: 12,
    props: false
  }
}))

API

fmtObj(obj, depth = infinity, colors = defaultColorMap, offset = 2)

Prettifies obj given a colors map with optional depth.

depth

Objects deeper than depth will get collapsed and hide their sub properties.

colors

fmt-obj uses chalk behind the scenes. Tweak it to your likes.

// default color map
{
  punctuation: chalk.yellow,
  property: chalk.green,
  literal: chalk.magenta,
  number: chalk.cyan,
  string: chalk.bold
}

Author

fmt-obj © Fabian Eichenberger, Released under the MIT License.
Authored and maintained by Fabian Eichenberger with help from contributors (list).

GitHub @queckezz · Twitter @queckezz

Keywords

FAQs

Package last updated on 16 Feb 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc