Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
live-typescript
Advanced tools
A simple React component to show live Typescript code samples.
Here's a simple example:
<LiveTypescript code="console.log('hello world');"/>
To import modules in your example code, use the provided plugin in a vite or rollup build: rollup-plugin-sourcefiles.
import pkgSource from "thimbleberry?sourceFiles";
<LiveTypescript embeddedPackages={[pkgSource]}
code="
import { mapN } from 'thimbleberry';
const seq = mapN(10).join(' ');
document.body.innerHTML = `<div> ${seq} </div>`;
"
> </LiveTypescript>
Here's a complete example using vite.
LiveTypescript works well in Docusaurus.
The recommended approach is to build (and test) your code examples in a separate vite/rollup package build, and then import the examples package into your documentation build.
Consider wrapping your LiveTypescript component in <BrowserOnly>
. The
current sandboxed execution doesn't run on the server anyway, and server side
rendering can lead to developer console warnings at runtime.
FAQs
A simple React component to show live Typescript code samples.
The npm package live-typescript receives a total of 3 weekly downloads. As such, live-typescript popularity was classified as not popular.
We found that live-typescript 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.