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.
![npm](https://img.shields.io/npm/v/hjsx?style=flat-square) ![tests](https://img.shields.io/badge/tests-passing-green?style=for-the-badge)
[!WARNING]
This project is still in early development and is not ready for use.
JSX is great for templating, but pulling in React can be overkill, and even when just using the types it can be confusing. hjsx (Hypertext + JavaScript Extensible Markup Language) aims to provide a simple way to use JSX on the server by rendering it to HTML.
It includes modified types for the JSX elements, with all event handlers removed, and a render
method that returns a string.
It is currently available on npm
, but I wouldn't recommend using it yet.
First, install the package:
bun i hjsx
Then you'll need to update your tsconfig.json to use the react-jsx
compiler option, and set the jsxFactory
and jsxFragmentFactory
options to hjsx
and hjsx.fragment
respectively:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxFactory": "hjsx",
"jsxFragmentFactory": "hjsx.fragment"
}
}
Now you can use JSX in your code:
import { type hjsx } from "hjsx";
type MyComponentProps = hjsx.Attributes & {};
export function MyComponent(props: MyComponentProps) {
return (
<>
<div {...props}>
<h1>c00l b34nz</h1>
</div>
</>
);
}
Check out the demo:
bun install
bun run examples/serve.ts
Contributions are welcome! Please help me. This is a cry for help.
FAQs
![npm](https://img.shields.io/npm/v/hjsx?style=for-the-badge) ![tests](https://img.shields.io/badge/tests-passing-green?style=for-the-badge)
The npm package hjsx receives a total of 1 weekly downloads. As such, hjsx popularity was classified as not popular.
We found that hjsx 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
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.