Documentation for Simbo's Packages
    Preparing search index...

    Options for the monorepo packages list.

    interface Options {
        after?: string | BeforeAfterFn;
        before?: string | BeforeAfterFn;
        delimiter?: string;
        filterFn?: FilterFn;
        sortCompareFn?: SortCompareFn;
        templateData?: TemplateData;
        templateFn?: (
            workspaceMetadata: WorkspaceMetadata,
            templateData: TemplateData,
        ) => string | Promise<string>;
        workingDir?: string;
    }
    Index

    Properties

    after?: string | BeforeAfterFn

    A string to add after the list. Can be a static string or a function that receives all workspaces metadata and returns a string.

    ""
    
    before?: string | BeforeAfterFn

    A string to add before the list. Can be a static string or a function that receives all workspaces metadata and returns a string. Defaults to a line of text mentioning the count of packages.

    delimiter?: string

    The delimiter to use between list items in the output.

    "\n\n"
    
    filterFn?: FilterFn

    A function to filter the workspaces to include in the list. Receives the workspace metadata and should return true to include it, or false to exclude it. The default value is to include all workspaces.

    (workspace) => true
    
    sortCompareFn?: SortCompareFn

    A function to compare two workspaces for sorting. Receives the metadata for both workspaces and should return a negative number if a should come before b, a positive number if a should come after b, or 0 if they are equal.

    The default value is to sort by workspace.relativePath in natural language order.

    templateData?: TemplateData

    Data to use in the template function.

    templateFn?: (
        workspaceMetadata: WorkspaceMetadata,
        templateData: TemplateData,
    ) => string | Promise<string>

    A template function to use for list items. Can optionally be async. The function will receive the workspace metadata and template data as arguments and should return the output string for each package entry. Defaults to a simple markdown template function.

    workingDir?: string

    The working directory to list packages from. Should be the root of the monorepo. Defaults to the current working directory.

    process.cwd()