diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index f8a2046e..a1600a83 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -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. @@ -13022,7 +13020,7 @@ 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. @@ -13030,6 +13028,26 @@ Logging is fully supported. Objects are stringified and logs are routed to the I 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. diff --git a/docs/reference/functions/typescript/node.md b/docs/reference/functions/typescript/node.md index cceae941..28a5eb06 100644 --- a/docs/reference/functions/typescript/node.md +++ b/docs/reference/functions/typescript/node.md @@ -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. @@ -28,7 +26,7 @@ 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. @@ -36,3 +34,26 @@ Logging is fully supported. Objects are stringified and logs are routed to the I 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 +```