fluentToResourceData() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Compile a Fluent resource (i.e. an FTL file) into a Map of Message data objects.


export declare function fluentToResourceData(source: string | Fluent.Resource, options?: FluentToMessageOptions): {
    data: FluentMessageResourceData;
    comments: string;


Parameter Type Description
source string | Fluent.Resource A Fluent resource, as the string contents of an FTL file or as a Fluent.Resource
options FluentToMessageOptions (Optional)


{ data: FluentMessageResourceData; comments: string; }

An object containing the messages as data and any resource-level comments of the resource.