@computesdk/cloudflare 1.0.1 → 1.1.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/README.md +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,6 +80,8 @@ export default {
|
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
82
|
import { cloudflare } from '@computesdk/cloudflare';
|
|
83
|
+
import { createCompute } from 'computesdk';
|
|
84
|
+
|
|
83
85
|
|
|
84
86
|
// Initialize the provider with your Durable Object binding
|
|
85
87
|
const provider = cloudflare({
|
|
@@ -91,8 +93,11 @@ const provider = cloudflare({
|
|
|
91
93
|
}
|
|
92
94
|
});
|
|
93
95
|
|
|
96
|
+
// Create a compute instance
|
|
97
|
+
const compute = createCompute({ provider });
|
|
98
|
+
|
|
94
99
|
// Create a sandbox
|
|
95
|
-
const sandbox = await
|
|
100
|
+
const sandbox = await compute.sandbox.create();
|
|
96
101
|
|
|
97
102
|
// Execute Python code
|
|
98
103
|
const result = await sandbox.runCode(`
|