
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
mdxliteA minimal MDX runtime for constrained environments, e.g. Cloudflare Workers.
@mdx-js/mdx usage during runtime requires use of eval (evaluate and evaluateSync) in order to transform and run mdx, unfortunately not all environments allow for use of eval - like Cloudflare Workers.
mdxlite works similar to @mdx-js/mdx, in that you can take a string of markdown with JSX and transform it, yet does so without using eval or new Function()!
bun add mdxlite
import { transformMarkdown } from 'mdxlite';
async function AsyncMarkdown({ children }): Promise<ReactNode> {
return await transformMarkdown({
markdown: children
// You can also provide custom components here:
components: {
Greeting({children}) {
return <marquee>{children}</marquee>
}
},
// as well as any imports that might occur within the MDX string
// **ALL** imports within the markdown string __must__ be provided here
imports: {
'./foo': {
namedExport: true,
default: function DefaultExport() {
return 'something';
}
}
}
});
}
async function handleRequest() {
let markdownString = `
# Hello World!
import Foo, {namedExport} from './foo';
<Foo />
export const message = "hi there!"
{namedExport ? message : '🥷'}
`.trim();
let body = await renderToReadableStream(
<AsyncMarkdown>{markdownString}</AsyncMarkdown>
)
return new Response(
body,
{
headers: {
'Content-Type': 'text/html'
}
}
);
}
This package was heavily inspired by, and uses most of the same code as the react-markdown package, and generally wouldn't be possible without many packages in the unifiedjs ecosystem.
This library uses swc and TypeScript to build the source code and generate types.
To build the library, run bun run build from the root, or from this workspace!
This library uses TypeScript to perform type checks, run bun run type-check from the root or from this workspace!
This library uses BiomeJS for linting, run bun run lint from the root or from this workspace!
This library uses Bun for running unit tests, run bun run test from the root or from this workspace!
To publish the library, run bun run pub from the workspace root. This will prompt you to login to npm and publish the package.
Note: In the future, we will automate this process using GitHub Actions. And also add in tooling to manage releases / changelogs!
FAQs
A minimal MDX runtime for constrained environments
We found that mdxlite 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.