
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
json-to-div
Advanced tools
Una función simple para renderizar un objeto JSON dentro de un elemento HTML de forma expandible y fácil de configurar
Una función simple para renderizar un objeto JSON dentro de un elemento HTML de forma expandible y personalizar fácilmente los estilos usando variables CSS.
npm install json-to-div
O puedes importarlo directamente en tu proyecto.
@import "https://unpkg.com/json-to-div/json-to-div.css";
import {jsonToDiv} from "https://unpkg.com/json-to-div/json-to-div.js";
La función principal es:
/**
* Crea la vista del JSON dentro de un elemento HTML
* @param {HTMLElement} div Elemento que renderiza el json
* @param {Object} json Objeto que se mostrará
*/
function json-to-div(div, json)
<div id="json"></div>
import { jsonToDiv } from "json-to-div/json-to-div.js";
const data = {
nombre: "Juan",
edad: 30,
activo: true,
direccion: {
ciudad: "Madrid",
cp: 28001
}
};
const contenedor = document.getElementById("json");
jsonToDiv(contenedor, data);
@import "json-to-div/json-to-div.css";
Esto generará una vista interactiva del JSON, permitiendo expandir o contraer objetos y arrays.
Puedes personalizar la apariencia fácilmente usando variables CSS.
Solo necesitas definir una clase con las variables:
.variables-json{
--jv-color-mas: blue;
--jv-color-menos: blue;
--jv-simbolo-expandir: "[+] ";
--jv-simbolo-contraer: "[-] ";
--jv-color-string: black;
--jv-color-val-null: blue;
--jv-color-val-cadena: green;
--jv-color-val-numero: blue;
--jv-simbolo-array: "[...]";
--jv-simbolo-array-exp: "[";
--jv-simbolo-array-cerrar: "]";
--jv-simbolo-obj: "{...}";
--jv-simbolo-obj-exp: "{";
--jv-simbolo-obj-cerrar: "}";
--jv-color-no-expandir: black;
--jv-color-expandir: black;
--jv-font-family: monospace;
--jv-font-size: 12px;
--jv-linea-tipo: dotted;
--jv-linea-size: 1px;
--jv-linea-color: black;
}
Solo añade la clase al contenedor:
<div id="json" class="variables-json"></div>
Esto te permite Personalizar:
<style>
@import "https://unpkg.com/json-to-div/json-to-div.css";
</style>
<div id="json" class="variables-json"></div>
<script>
import { jsonToDiv } from "https://unpkg.com/json-to-div/json-to-div.js";
const json = {
usuario: "Carlos",
edad: 25,
lenguajes: ["JavaScript", "Python", "Go"],
activo: true
};
const contenedor = document.getElementById("json");
jsonToDiv(contenedor, json);
</script>
FAQs
Una función simple para renderizar un objeto JSON dentro de un elemento HTML de forma expandible y fácil de configurar
We found that json-to-div demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.