Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@devbookhq/sdk
Advanced tools
Devbook allows visitors of your docs to interact with and execute any code snippet or shell command in a private VM
Devbook makes your dev docs interactive with just 3 lines of code.
Devbook is a JS library that allows visitors of your docs to interact with and execute any code snippet or shell command in a private VM.
Every time a user visits a page where you use Devbook (like your docs), we quickly spin up a private VM just for that user. They can experiment and explore your API/SDK right from your docs. Zero setup and overhead.
Check this Twitter thread with a video to see Devbook in action.
npm install @devbookhq/sdk
// 1. Import the hook.
import { useDevbook, Env } from '@devbookhq/sdk'
// 2. Define your code.
const code = `
> Code that you want to execute in a VM goes here.
`
function InteractiveCodeSnippet() {
const { stdout, stderr, runCode } = useDevbook({ env: Env.NodeJS })
return (
<div>
<button onClick={() => runCode(code)}>Run</button>
<h3>Output</h3>
{stdout.map((o, idx) => <span key={`out_${idx}`}>{o}</span>)}
{stderr.map((e, idx) => <span key={`err_${idx}`}>{e}</span>)}
</div>
)
}
export default InteractiveCodeSnippet
import { Devbook, Env } from '@devbookhq/sdk'
// 2. Define your code.
const code = `
> Code that you want to execute in a VM goes here.
`
// 3. Define callbacks.
function handleStdout(out: string) {
console.log('stdout', { err })
}
function handleStderr(err: string) {
console.log('stderr', { err })
}
// 4. Create new Devbook instance.
const dbk = new Devbook({ env: Env.NodeJS, onStdout: handleStdout, onStderr: handleStderr })
dbk.runCode(code)
FAQs
SDK for managing Devbook sessions from JavaScript/TypeScript
We found that @devbookhq/sdk 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.