preprocess
preprocess(
options):Promise<PreprocessResult>
Defined in: preprocess/pipeline.ts:63
Preprocess a specification document
Loads configuration (if provided) and resolves all includes to produce a PreprocessedSpec ready for parsing.
Parameters
Section titled “Parameters”options
Section titled “options”Preprocess options
Returns
Section titled “Returns”Promise<PreprocessResult>
PreprocessResult with spec and diagnostics
Example
Section titled “Example”const result = await preprocess({ entry: '/specs/my-spec/format.md', configPath: '/specs/my-spec/config.respec.json', fileProvider: new NodeFileProvider(),});
if (result.hasErrors) { console.error('Preprocess errors:', result.diagnostics);} else { // result.result contains PreprocessedSpec for (const unit of result.result.source.units) { console.log(`Processing: ${unit.file}`); }}