Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Typically you use Python to run AI-generated code for data analysis but you can
Out of the box E2B Sandbox supports:
- [Python](/docs/code-interpreting/supported-languages/python)
- [JavaScript](/docs/code-interpreting/supported-languages/javascript)
- [TypeScript](/docs/code-interpreting/supported-languages/typescript)
- [R](/docs/code-interpreting/supported-languages/r)
- [Java](/docs/code-interpreting/supported-languages/java)
- [Bash](/docs/code-interpreting/supported-languages/bash)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Run TypeScript code
Use the `runCode`/`run_code` method to run TypeScript code inside the sandbox.
You'll need to pass the `language` parameter with value `typescript` or `ts`.

<CodeGroup>
```js
import { Sandbox } from '@e2b/code-interpreter'

const sbx = await Sandbox.create()
await sbx.runCode(`const greeting: string = "Hello, world!"`, { language: 'ts' })
const execution = await sbx.runCode('console.log(greeting)', { language: 'ts' })
console.log(execution)
```
```python
from e2b_code_interpreter import Sandbox

sbx = Sandbox()
sbx.run_code("const greeting: string = 'Hello, world!'", language="ts")
execution = sbx.run_code('console.log(greeting)', language="ts")
print(execution)
```
</CodeGroup>
12 changes: 11 additions & 1 deletion apps/web/src/components/Navigation/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { Braces, CheckCircle, Home, KeyRound, MessagesSquare } from 'lucide-react'
import {
Braces,
CheckCircle,
Home,
KeyRound,
MessagesSquare,
} from 'lucide-react'
import sdkRefRoutesJson from './sdkRefRoutes.json'

enum Tag {
Expand Down Expand Up @@ -184,6 +190,10 @@ export const docRoutes: NavGroup[] = [
title: 'JavaScript',
href: '/docs/code-interpreting/supported-languages/javascript',
},
{
title: 'TypeScript',
href: '/docs/code-interpreting/supported-languages/typescript',
},
{
title: 'R',
href: '/docs/code-interpreting/supported-languages/r',
Expand Down