Categories
function writeImportMap
writeImportMap(options: WriteImportMapOptions): string

Create an import map and write it to disk, creating parent directories as needed.

Relative targets are automatically rebased from the project root to the output directory.

Examples

Example 1

// Write the conventional Deno import map file.
import { writeImportMap } from 'jsr:@kjanat/importmapify';

const output = writeImportMap({ root: Deno.cwd() });

console.log(`Wrote ${output}`);

Parameters

Creation options plus the optional output path.

Return Type

string

The absolute path of the written file.