Skip to content
Merged
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
32 changes: 25 additions & 7 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13000,15 +13000,13 @@ The TypeScript runtime used in Juno does not provide full Node.js support. Polyf

If you require a specific Node.js feature or are blocked by a missing polyfill, please reach out or open an issue. Features are prioritized based on usage and compatibility.

---

## Globals
The following globals are available out of the box, without any imports.

Some global functions are supported but come with important limitations or added details.
---

### Math.random
## Math.random

Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive) is supported.
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive).

However, the generator is seeded once after upgrade of the Satellite. Use it with caution.

Expand All @@ -13022,14 +13020,34 @@ const value = Math.random();

---

### Console
## Console

Logging is fully supported. Objects are stringified and logs are routed to the IC-CDK `print()` function, making them visible in your Satellite logs including inside the Juno Console UI in development or production.

```
console.log("Hello from the Satellite");console.info("Hello", { type: "info", msg: "Something happened" });
```

---

## Blob

`Blob` represents immutable raw binary data.

```
const blob = new Blob(["Hello from the Satellite"], { type: "text/plain" });const text = await blob.text();
```

---

## URL

Parses and manipulates URLs with `URL` and `URLSearchParams`.

```
const url = new URL("https://example.com?foo=bar");console.log(url.hostname); // example.comconsole.log(url.searchParams.get("foo")); // bar
```

# Schema Types

Juno provides a type system built on top of [Zod](https://zod.dev/), extended with a few additional types you'll need when working with serverless functions.
Expand Down
35 changes: 28 additions & 7 deletions docs/reference/functions/typescript/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ The TypeScript runtime used in Juno does not provide full Node.js support. Polyf

If you require a specific Node.js feature or are blocked by a missing polyfill, please reach out or open an issue. Features are prioritized based on usage and compatibility.

---

## Globals
The following globals are available out of the box, without any imports.

Some global functions are supported but come with important limitations or added details.
---

### Math.random
## Math.random

Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive) is supported.
Generates a pseudo-random number between 0 (inclusive) and 1 (exclusive).

However, the generator is seeded once after upgrade of the Satellite. Use it with caution.

Expand All @@ -28,11 +26,34 @@ const value = Math.random();

---

### Console
## Console

Logging is fully supported. Objects are stringified and logs are routed to the IC-CDK `print()` function, making them visible in your Satellite logs including inside the Juno Console UI in development or production.

```typescript
console.log("Hello from the Satellite");
console.info("Hello", { type: "info", msg: "Something happened" });
```

---

## Blob

`Blob` represents immutable raw binary data.

```typescript
const blob = new Blob(["Hello from the Satellite"], { type: "text/plain" });
const text = await blob.text();
```

---

## URL

Parses and manipulates URLs with `URL` and `URLSearchParams`.

```typescript
const url = new URL("https://example.com?foo=bar");
console.log(url.hostname); // example.com
console.log(url.searchParams.get("foo")); // bar
```
Loading