modal 0.3.24 → 0.5.0-dev.6

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,26 +1,66 @@
1
- # Modal JavaScript Library
1
+ # Modal JavaScript SDK
2
2
 
3
- [![Documentation](https://img.shields.io/badge/docs-reference-blue)](https://modal-labs.github.io/libmodal/)
4
- [![Version](https://img.shields.io/npm/v/modal.svg)](https://www.npmjs.org/package/modal)
5
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)
6
- [![Downloads](https://img.shields.io/npm/dm/modal.svg)](https://www.npmjs.com/package/modal)
4
+ [![JS Reference Documentation](https://img.shields.io/badge/docs-reference-blue)](https://modal-labs.github.io/libmodal/)
5
+ [![npm Version](https://img.shields.io/npm/v/modal.svg)](https://www.npmjs.org/package/modal)
6
+ [![npm Downloads](https://img.shields.io/npm/dm/modal.svg)](https://www.npmjs.com/package/modal)
7
7
 
8
- The [Modal](https://modal.com/) JavaScript SDK allows you to run Modal Functions and Sandboxes from server-side JavaScript applications.
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.
9
9
 
10
10
  It comes with built-in TypeScript type definitions.
11
11
 
12
- ## Documentation
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.
13
+
14
+ ## Installation
13
15
 
14
- See the [documentation and examples](https://github.com/modal-labs/libmodal?tab=readme-ov-file#javascript-modal-js) on GitHub.
16
+ Install this in any server-side Node.js / Deno / Bun project.
17
+
18
+ ```bash
19
+ npm install modal
20
+ ```
21
+
22
+ npm package: https://www.npmjs.com/package/modal
15
23
 
16
24
  ## Requirements
17
25
 
18
- Node 22 or higher. We bundle both ES Modules and CommonJS formats, so you can load the package with either `import` or `require()` in any project.
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.
19
27
 
20
- ## Installation
28
+ ## Documentation
29
+
30
+ See the main [Modal documentation](https://modal.com/docs/guide) 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/).
31
+
32
+ We also provide a number of examples:
33
+
34
+ - [Call a deployed Function](./examples/function-call.ts)
35
+ - [Spawn a deployed Function](./examples/function-spawn.ts)
36
+ - [Call a deployed Cls](./examples/cls-call.ts)
37
+ - [Call a deployed Cls, and override its options](./examples/cls-call-with-options.ts)
38
+ - [Create a Sandbox](./examples/sandbox.ts)
39
+ - [Create a named Sandbox](./examples/sandbox-named.ts)
40
+ - [Create a Sandbox with GPU](./examples/sandbox-gpu.ts)
41
+ - [Create a Sandbox using a private image from AWS ECR](./examples/sandbox-private-image.ts)
42
+ - [Take a snapshot of the filesystem of a Sandbox](./examples/sandbox-filesystem-snapshot.ts)
43
+ - [Execute Sandbox commands](./examples/sandbox-exec.ts)
44
+ - [Running a coding agent in a Sandbox](./examples/sandbox-agent.ts)
45
+ - [Check the status and exit code of a Sandbox](./examples/sandbox-poll.ts)
46
+ - [Access Sandbox filesystem](./examples/sandbox-filesystem.ts)
47
+ - [Expose ports on a Sandbox using Tunnels](./examples/sandbox-tunnels.ts)
48
+ - [Include Secrets in Sandbox](./examples/sandbox-secrets.ts)
49
+ - [Mount a Volume to a Sandbox](./examples/sandbox-volume.ts), and same but [with an ephemeral Volume](./examples/sandbox-volume-ephemeral.ts)
50
+ - [Mount a cloud bucket to a Sandbox](./examples/sandbox-cloud-bucket.ts)
51
+ - [Eagerly build an Image for a Sandbox](./examples/sandbox-prewarm.ts)
52
+ - [Building custom Images](./examples/image-building.ts)
21
53
 
22
- Install the package with
54
+ ### Authenticating with Modal
55
+
56
+ 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:
23
57
 
24
58
  ```bash
25
- npm install modal
59
+ # Replace these with your actual token!
60
+ export MODAL_TOKEN_ID=ak-NOTAREALTOKENSTRINGXYZ
61
+ export MODAL_TOKEN_SECRET=as-FAKESECRETSTRINGABCDEF
26
62
  ```
63
+
64
+ ## Support
65
+
66
+ For usage questions and other support, please reach out on the [Modal Community Slack](https://modal.com/slack).