Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
fmt-obj
Prettifies any javascript object in your console. Make it look awesome! :lipstick:
Screenshot
npm install --save fmt-obj
Or even better
yarn add fmt-obj
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
}
}))
fmtObj(obj, depth = Infinity, colors = defaultColorMap, offset = 2)
Prettifies obj
given a colors
map with optional depth
.
depth
(optional)Objects deeper than depth
will get collapsed and hide their sub properties.
colors
(optional)fmt-obj
uses chalk
behind the scenes.
You can tweak the color mapping by the following tokens:
:
and "
true
, false
, null
or undefined
Here is an example of using a custom color map:
const format = require('fmt-obj')
const chalk = require('chalk')
const customFormat = (...args) => format(...args, {
punctuation: chalk.cyan,
property: chalk.yellow,
literal: chalk.blue,
number: chalk.green,
string: chalk.bold
})
console.log(customFormat({ hello: 1.0 }))
{
punctuation: chalk.yellow,
property: chalk.green,
literal: chalk.magenta,
number: chalk.cyan,
string: chalk.bold
}
offset
(optional)The amount of whitespace after the object gets displayed.
(Because package discovery is hard)
pretty-format
by @thejameskyle for additional ES6 type support (WeakMap, WeakSet, Symbol etc.) and more consistent output.fmt-obj © Fabian Eichenberger, Released under the MIT License.
Authored and maintained by Fabian Eichenberger with help from contributors (list).
FAQs
Prettifies any javascript object in your console
The npm package fmt-obj receives a total of 708 weekly downloads. As such, fmt-obj popularity was classified as not popular.
We found that fmt-obj demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.