Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jsonmltoreact
Advanced tools
JsonML to React converter
$ npm i --save jsonmltoreact
import _ from 'lodash';
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import JsonmlToReact from 'jsonmltoreact';
// Some random React component
class CustomCompoenent extends React.Component {
render() {
return (
<div className="customCompoenentContainer">
{this.props.header && <h1>{this.props.header}</h1>}
{this.props.subheader && <h2>{this.props.subheader}</h2>}
{this.props.children}
</div>
);
}
}
// Create instance with custom converters
let jsonmlToReact = new JsonmlToReact({
'custom-tag': (props, data) => ({
type: CustomCompoenent,
props: { ...props, ...data },
}),
'span': props => ({
props: {
className: 'foobar'
}
})
});
// JsonML tree
let jsonml = [
'div', { class: 'container' },
[
'custom-tag', { subheader: 'bar' },
[
'span', 'content'
]
]
];
// Optional data to be passed to converters
let data = {
'header': 'foo',
};
let reactComponent = jsonmlToReact.convert(jsonml, data);
console.log(ReactDOMServer.renderToStaticMarkup(reactComponent));
/*
<div class="container">
<div class="customCompoenentContainer">
<h1>foo</h1>
<h2>bar</h2>
<span class="foobar">content</span>
</div>
</div>
*/
FAQs
JsonML to React component converter
The npm package jsonmltoreact receives a total of 2 weekly downloads. As such, jsonmltoreact popularity was classified as not popular.
We found that jsonmltoreact demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.