
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
jsx-html-runtime
Advanced tools
An asynchronous JSX runtime without dependencies to be used as server-side rendering HTML template engine.
An asynchronous JSX runtime without dependencies to be used as server-side rendering HTML template engine.
npm i jsx-html-runtime
To make use of the jsx-html-runtime
, you need to configure your transpiler to utilize this package for transforming the JSX syntax.
If you are using TypeScript for transpiling, simply set these options in the tsconfig file:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "jsx-html-runtime"
}
}
If you're using templates in a server app, you might want to include data from a database in the HTML you serve to the client.
To simplify this process, you can make your components asynchronous and send async requests from within them.
You can check out the example project to learn about all the features.
import { renderToHtml } from "jsx-html-runtime";
export default function App() {
return (
<html>
<head>
<meta charset="utf-8" />
<title>Todos</title>
</head>
<body>
<Header label="Todos" />
<TodoList quantity={3} />
</body>
</html>
);
}
function Header({ label }) {
return (
<section
style={{
"background-color": "red",
"padding-bottom": "1rem",
}}
>
<h1 style="color: white; text-align: center">{label}</h1>
</section>
);
}
async function TodoList({ quantity }) {
const { todos } = await (await fetch("https://dummyjson.com/todos")).json();
return (
<table class="table">
<thead class={{ thead: true, striped: false, sticky: true }}>
<tr>
<th>Label</th>
<th>Status</th>
</tr>
</thead>
<tbody class="tbody striped">
{todos.slice(0, quantity).map(({ todo, completed }) => (
<tr>
<td>
<label for="todo">{todo}</label>
</td>
<td>
<label for="status">{completed ? "yes" : "no"}</label>
</td>
</tr>
))}
</tbody>
</table>
);
}
const html = `<!DOCTYPE html>\n${await renderToHtml(<App />, { indent: 1 })}`;
console.log(html);
FAQs
An asynchronous JSX runtime without dependencies to be used as server-side rendering HTML template engine.
The npm package jsx-html-runtime receives a total of 0 weekly downloads. As such, jsx-html-runtime popularity was classified as not popular.
We found that jsx-html-runtime 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.