diff --git a/src/content/chainlink-functions/tutorials/importing-packages.mdx b/src/content/chainlink-functions/tutorials/importing-packages.mdx index 7660bd9ce0c..b8ca8b25516 100644 --- a/src/content/chainlink-functions/tutorials/importing-packages.mdx +++ b/src/content/chainlink-functions/tutorials/importing-packages.mdx @@ -21,10 +21,31 @@ This tutorial demonstrates how to import modules and use them with your Function - Up to 20 imports total are supported. - Deno supports [ESM compatible NPM imports](https://docs.deno.com/runtime/manual/node/npm_specifiers) and some [standard Node modules](https://docs.deno.com/runtime/manual/node/node_specifiers). See the [Compatability List](https://docs.deno.com/runtime/manual/node/compatibility) for details. - Third-party modules are imported at runtime, so import statements must use asynchronous logic like the following examples: - - Importing from `deno.land`: `const { escape } = await import("https://deno.land/std/regexp/mod.ts");` - - ESM-compatible packages: `const { format } = await import("npm:date-fns");` - - Standard Node modules: `const path = await import("node:path");` - - CDN imports: `const lodash = await import("http://cdn.skypack.dev/lodash");` + + - Importing from `deno.land`: + + ```javascript + const { escape } = await import("https://deno.land/std/regexp/mod.ts") + ``` + + - ESM-compatible packages: + + ```javascript + const { format } = await import("npm:date-fns") + ``` + + - Standard Node modules: + + ```javascript + const path = await import("node:path") + ``` + + - CDN imports: + + ```javascript + const lodash = await import("http://cdn.skypack.dev/lodash") + ``` + - Imported modules abide by all sandbox restrictions and do not have access to the file system, environment variables, or any other Deno permissions.