scan

function
function scan<TMetadata>(
  options?: ScanOptions<TMetadata>
): Promise<ScanResult<TMetadata>>;

Scan for examples using automatic config discovery.

This is the simplest entry point for programmatic scanning.
It discovers the nearest config file, loads it, resolves plugins,
and runs the scanner — all in one call.

PARAMETERS

NAMETYPEDESCRIPTION
options?ScanOptions<TMetadata>—

RETURNS

Promise<ScanResult<TMetadata>>

TYPE PARAMETERS

  • TMetadata = Record<string, unknown>

EXAMPLES

import { scan } from 'functional-examples';

// Auto-discover config from cwd
const result = await scan();

// Discover config from a specific directory
const result = await scan({ root: '/path/to/project' });

// Skip discovery and use a pre-resolved config
const result = await scan({ config: myResolvedConfig });