modal 0.7.2 → 0.7.3-dev.1

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 CHANGED
@@ -1,15 +1,19 @@
1
1
  # Modal JavaScript SDK
2
2
 
3
- [![Build Status](https://github.com/modal-labs/libmodal/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/modal-labs/libmodal/actions?query=branch%3Amain)
4
3
  [![JS Reference Documentation](https://img.shields.io/badge/docs-reference-blue)](https://modal-labs.github.io/libmodal/)
5
4
  [![npm Version](https://img.shields.io/npm/v/modal.svg)](https://www.npmjs.org/package/modal)
6
5
  [![npm Downloads](https://img.shields.io/npm/dm/modal.svg)](https://www.npmjs.com/package/modal)
7
6
 
8
- The [Modal](https://modal.com/) JavaScript SDK provides convenient, on-demand access to serverless cloud compute on Modal from JS/TS projects. Use it to safely run arbitrary code in Modal Sandboxes, call Modal Functions, and interact with Modal resources.
7
+ The [Modal](https://modal.com/) JavaScript SDK provides convenient, on-demand
8
+ access to serverless cloud compute on Modal from JS/TS projects. Use it to
9
+ safely run arbitrary code in Modal Sandboxes, call Modal Functions, and interact
10
+ with Modal resources.
9
11
 
10
12
  It comes with built-in TypeScript type definitions.
11
13
 
12
- We're approaching feature parity with the main [Modal Python SDK](https://github.com/modal-labs/modal-client), although defining Modal Functions will likely remain exclusive to Python.
14
+ We're approaching feature parity with the main
15
+ [Modal Python SDK](https://github.com/modal-labs/modal-client), although
16
+ defining Modal Functions will likely remain exclusive to Python.
13
17
 
14
18
  ## Installation
15
19
 
@@ -23,44 +27,54 @@ npm package: https://www.npmjs.com/package/modal
23
27
 
24
28
  ## Requirements
25
29
 
26
- Node 22 or later. We bundle both ES Modules and CommonJS formats, so you can load the package with either `import` or `require()` in any project.
30
+ Node 22 or later. We bundle both ES Modules and CommonJS formats, so you can
31
+ load the package with either `import` or `require()` in any project.
27
32
 
28
33
  ## Documentation
29
34
 
30
- See the main [Modal documentation](https://modal.com/docs) and [user guides](https://modal.com/docs/guide) for high-level overviews. For details, see the [API reference documentation for for JS](https://modal-labs.github.io/libmodal/).
35
+ See the main [Modal documentation](https://modal.com/docs) and
36
+ [user guides](https://modal.com/docs/guide) for high-level overviews. For
37
+ details, see the
38
+ [API reference documentation for for JS](https://modal-labs.github.io/libmodal/).
31
39
 
32
40
  We also provide a number of examples:
33
41
 
34
- - [Call a deployed Function](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/function-call.ts)
35
- - [Spawn a deployed Function](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/function-spawn.ts)
36
- - [Call a deployed Cls](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/cls-call.ts)
37
- - [Call a deployed Cls, and override its options](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/cls-call-with-options.ts)
38
- - [Create a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox.ts)
39
- - [Create a named Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-named.ts)
40
- - [Create a Sandbox with GPU](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-gpu.ts)
41
- - [Create a Sandbox using a private image from AWS ECR](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-private-image.ts)
42
- - [Take a snapshot of the filesystem of a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-filesystem-snapshot.ts)
43
- - [Snapshot a directory, and mount it in a running Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-directory-snapshot.ts)
44
- - [Execute Sandbox commands](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-exec.ts)
45
- - [Running a coding agent in a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-agent.ts)
46
- - [Check the status and exit code of a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-poll.ts)
47
- - [Access Sandbox filesystem](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-filesystem.ts)
48
- - [Expose ports on a Sandbox using Tunnels](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-tunnels.ts)
49
- - [Create connect tokens for a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-connect-token.ts)
50
- - [Include Secrets in Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-secrets.ts)
51
- - [Mount a Volume to a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-volume.ts), and same but [with an ephemeral Volume](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-volume-ephemeral.ts)
52
- - [Mount a cloud bucket to a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-cloud-bucket.ts)
53
- - [Eagerly build an Image for a Sandbox](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/sandbox-prewarm.ts)
54
- - [Building custom Images](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/image-building.ts)
55
- - [Add telemetry and tracing with custom middleware](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/telemetry.ts)
42
+ - [Call a deployed Function](https://github.com/modal-labs/modal-client/blob/main/js/examples/function-call.ts)
43
+ - [Spawn a deployed Function](https://github.com/modal-labs/modal-client/blob/main/js/examples/function-spawn.ts)
44
+ - [Call a deployed Cls](https://github.com/modal-labs/modal-client/blob/main/js/examples/cls-call.ts)
45
+ - [Call a deployed Cls, and override its options](https://github.com/modal-labs/modal-client/blob/main/js/examples/cls-call-with-options.ts)
46
+ - [Create a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox.ts)
47
+ - [Create a named Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-named.ts)
48
+ - [Create a Sandbox with GPU](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-gpu.ts)
49
+ - [Create a Sandbox using a private image from AWS ECR](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-private-image.ts)
50
+ - [Take a snapshot of the filesystem of a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-filesystem-snapshot.ts)
51
+ - [Snapshot a directory, and mount it in a running Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-directory-snapshot.ts)
52
+ - [Execute Sandbox commands](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-exec.ts)
53
+ - [Running a coding agent in a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-agent.ts)
54
+ - [Check the status and exit code of a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-poll.ts)
55
+ - [Access Sandbox filesystem](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-filesystem.ts)
56
+ - [Expose ports on a Sandbox using Tunnels](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-tunnels.ts)
57
+ - [Create connect tokens for a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-connect-token.ts)
58
+ - [Include Secrets in Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-secrets.ts)
59
+ - [Mount a Volume to a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-volume.ts),
60
+ and same but
61
+ [with an ephemeral Volume](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-volume-ephemeral.ts)
62
+ - [Mount a cloud bucket to a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-cloud-bucket.ts)
63
+ - [Eagerly build an Image for a Sandbox](https://github.com/modal-labs/modal-client/blob/main/js/examples/sandbox-prewarm.ts)
64
+ - [Building custom Images](https://github.com/modal-labs/modal-client/blob/main/js/examples/image-building.ts)
65
+ - [Add telemetry and tracing with custom middleware](https://github.com/modal-labs/modal-client/blob/main/js/examples/telemetry.ts)
56
66
 
57
67
  ### Configuration
58
68
 
59
- The config file path can be customized via `MODAL_CONFIG_PATH` (defaults to `~/.modal.toml`).
69
+ The config file path can be customized via `MODAL_CONFIG_PATH` (defaults to
70
+ `~/.modal.toml`).
60
71
 
61
72
  ### Authenticating with Modal
62
73
 
63
- You also need to authenticate with Modal (see [Getting started](https://modal.com/docs/guide#getting-started)). Either sign in with the Modal CLI using `pip install modal && modal setup`, or in machine environments set these environment variables:
74
+ You also need to authenticate with Modal (see
75
+ [Getting started](https://modal.com/docs/guide#getting-started)). Either sign in
76
+ with the Modal CLI using `pip install modal && modal setup`, or in machine
77
+ environments set these environment variables:
64
78
 
65
79
  ```bash
66
80
  # Replace these with your actual token!
@@ -70,8 +84,14 @@ export MODAL_TOKEN_SECRET=as-FAKESECRETSTRINGABCDEF
70
84
 
71
85
  ### Telemetry and Observability
72
86
 
73
- The Modal JavaScript SDK supports custom gRPC middleware for telemetry, tracing, and observability. You can add custom middleware to measure API call latency, trace requests, and integrate with observability tools like OpenTelemetry, DataDog, and others. See the [telemetry example](https://github.com/modal-labs/libmodal/blob/main/modal-js/examples/telemetry.ts) for more details.
87
+ The Modal JavaScript SDK supports custom gRPC middleware for telemetry, tracing,
88
+ and observability. You can add custom middleware to measure API call latency,
89
+ trace requests, and integrate with observability tools like OpenTelemetry,
90
+ DataDog, and others. See the
91
+ [telemetry example](https://github.com/modal-labs/modal-client/blob/main/js/examples/telemetry.ts)
92
+ for more details.
74
93
 
75
94
  ## Support
76
95
 
77
- For usage questions and other support, please reach out on the [Modal Community Slack](https://modal.com/slack).
96
+ For usage questions and other support, please reach out on the
97
+ [Modal Community Slack](https://modal.com/slack).