@cloudbase/e2b 2.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 FOUNDRYLABS, INC.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ <p align="center">
2
+ <img width="100" src="https://raw.githubusercontent.com/e2b-dev/E2B/refs/heads/main/readme-assets/logo-circle.png" alt="e2b logo">
3
+ </p>
4
+
5
+ <h4 align="center">
6
+ <a href="https://www.npmjs.com/package/e2b">
7
+ <img alt="Last 1 month downloads for the JavaScript SDK" loading="lazy" width="200" height="20" decoding="async" data-nimg="1"
8
+ style="color:transparent;width:auto;height:100%" src="https://img.shields.io/npm/dm/e2b?label=NPM%20Downloads">
9
+ </a>
10
+ </h4>
11
+
12
+ <!---
13
+ <img width="100%" src="/readme-assets/preview.png" alt="Cover image">
14
+ --->
15
+ ## What is E2B?
16
+ [E2B](https://www.e2b.dev/) is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our [JavaScript SDK](https://www.npmjs.com/package/e2b) or [Python SDK](https://pypi.org/project/e2b).
17
+
18
+ ## Run your first Sandbox
19
+
20
+ ### 1. Install SDK
21
+
22
+ ```bash
23
+ npm i e2b
24
+ ```
25
+
26
+ ### 2. Get your E2B API key
27
+ 1. Sign up to E2B [here](https://e2b.dev).
28
+ 2. Get your API key [here](https://e2b.dev/dashboard?tab=keys).
29
+ 3. Set environment variable with your API key
30
+ ```
31
+ E2B_API_KEY=e2b_***
32
+ ```
33
+
34
+ ### 3. Start a sandbox and run commands
35
+
36
+ ```ts
37
+ import Sandbox from 'e2b'
38
+
39
+ const sandbox = await Sandbox.create()
40
+ const result = await sandbox.commands.run('echo "Hello from E2B!"')
41
+ console.log(result.stdout) // Hello from E2B!
42
+ ```
43
+
44
+ ### 4. Code execution with Code Interpreter
45
+
46
+ If you need [`runCode()`](https://e2b.dev/docs/code-interpreting), install the [Code Interpreter SDK](https://github.com/e2b-dev/code-interpreter):
47
+
48
+ ```bash
49
+ npm i @e2b/code-interpreter
50
+ ```
51
+
52
+ ```ts
53
+ import { Sandbox } from '@e2b/code-interpreter'
54
+
55
+ const sandbox = await Sandbox.create()
56
+ const execution = await sandbox.runCode('x = 1; x += 1; x')
57
+ console.log(execution.text) // outputs 2
58
+ ```
59
+
60
+ ### 5. Check docs
61
+ Visit [E2B documentation](https://e2b.dev/docs).
62
+
63
+ ### 6. E2B cookbook
64
+ Visit our [Cookbook](https://github.com/e2b-dev/e2b-cookbook/tree/main) to get inspired by examples with different LLMs and AI frameworks.