---
title: "renderImportMap"
description: "Serializes an import map into an inline `<script type=\"importmap\">` element for server-rendered HTML, or `\"\"` when the map has no mappings."
url: "https://pitlane.tools/package/assets/function/renderImportMap"
---

# renderImportMap

```ts
import { renderImportMap } from "@pitlane/assets";
```

```ts
function renderImportMap(__namedParameters): string;
```

Serializes an import map into an inline `<script type="importmap">` element for server-rendered HTML, or `""` when the map has no mappings.

Every `<` in the JSON is written as `\u003c`, so no key or URL can end the script element; the browser parses the same strings back. The nonce is written as an escaped, quoted attribute. Place the result before any `modulepreload` link or module script.

## Parameters

### \_\_namedParameters

[`RenderImportMapOptions`](https://pitlane.tools/package/assets/interface/RenderImportMapOptions.md)

## Returns

`string`
