E2B-4.ts
· 204 B · TypeScript
Sin formato
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
await sbx.runCode('x = 1')
const execution = await sbx.runCode('x+=1; x')
console.log(execution.text) // outputs 2
1 | import { Sandbox } from '@e2b/code-interpreter' |
2 | |
3 | const sandbox = await Sandbox.create() |
4 | await sbx.runCode('x = 1') |
5 | |
6 | const execution = await sbx.runCode('x+=1; x') |
7 | console.log(execution.text) // outputs 2 |