sdf-parser
    Preparing search index...

    Interface ParseOptions

    Options for the parse function.

    interface ParseOptions {
        dynamicTyping?: boolean;
        eol?: string;
        exclude?: string[];
        filter?: (molecule: Molecule) => boolean;
        forEach?: Record<string, (value: unknown) => void>;
        include?: string[];
        mixedEOL?: boolean;
        modifiers?: Record<string, (value: string) => unknown>;
    }
    Index

    Properties

    dynamicTyping?: boolean

    When true, numeric string values are automatically converted to numbers.

    true
    
    eol?: string

    End-of-line character. Auto-detected from the file content when not set.

    '\n'
    
    exclude?: string[]

    Exclude fields whose names appear in this list. When combined with include, the field must satisfy both constraints.

    filter?: (molecule: Molecule) => boolean

    A predicate function to filter molecules. Only molecules for which this function returns true are included in the result.

    forEach?: Record<string, (value: unknown) => void>

    Callback functions called for each field value. The callbacks are stored on the label info and available in statistics.

    include?: string[]

    Only include fields whose names appear in this list. When combined with exclude, the field must satisfy both constraints.

    mixedEOL?: boolean

    When true, normalises all \r\n and \r sequences to \n before parsing. Useful for SDF files with mixed or Windows-style line endings.

    false
    
    modifiers?: Record<string, (value: string) => unknown>

    Modifier functions applied to field values after parsing. The function receives the raw string value and may return a transformed value. Returning undefined or null removes the field from the molecule.