Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
json-pretty-html
Advanced tools
Readme
Transforms a JSON object into an HTML string. Allows selecting a subset of the object and highlight it with a CSS class.
var json = {
"id": 2,
"name": "An ice sculpture",
"price": 12.50,
"tags": ["cold", "ice"],
"dimensions": {
"length": 7.0,
"width": 12.0,
"height": 9.5
},
"warehouseLocation": {
"latitude": -78.75,
"longitude": 20.4
}
};
var prettyHtml = require('json-pretty-html').default;
var html = prettyHtml(json, json.dimensions);
With a nice CSS, the result will be:
You can use the default 'darcula' like stylesheet.
Or you can define your own styles. See below the list of CSS classes used in the generated HTML:
CSS Class | Purpose |
---|---|
json-pretty | A div grouping several lines, delimited by the start/end of the object or the start/end of the selection |
json-selected | The current selection div, if any. Always associated with the json-pretty class. |
json-key | Object key, excluding double quotes |
json-string | String value, excluding double quotes |
json-number | Number value |
json-boolean | Boolean value |
FAQs
Transforms a JSON object to a pretty piece of HTML Edit
The npm package json-pretty-html receives a total of 1,384 weekly downloads. As such, json-pretty-html popularity was classified as popular.
We found that json-pretty-html 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.