Documentation for Simbo's Packages
    Preparing search index...
    interface Options {
        absolute?: boolean;
        baseNameMatch?: boolean;
        braceExpansion?: boolean;
        caseSensitiveMatch?: boolean;
        concurrency?: number;
        cwd?: string | URL;
        deep?: number;
        dot?: boolean;
        expandDirectories?: ExpandDirectoriesOption;
        expandNegationOnlyPatterns?: boolean;
        extglob?: boolean;
        followSymbolicLinks?: boolean;
        fs?: Partial<FileSystemAdapter>;
        gitignore?: boolean;
        globstar?: boolean;
        ignore?: string[];
        ignoreFiles?: string | readonly string[];
        markDirectories?: boolean;
        matcher?: MatcherFunction;
        objectMode?: boolean;
        onlyDirectories?: boolean;
        onlyFiles?: boolean;
        stats?: boolean;
        suppressErrors?: boolean;
        throwErrorOnBrokenSymbolicLink?: boolean;
        unique?: boolean;
    }

    Hierarchy

    • Options
      • Options
    Index
    absolute?: boolean

    Return the absolute path for entries.

    false
    
    baseNameMatch?: boolean

    If set to true, then patterns without slashes will be matched against the basename of the path if it contains slashes.

    false
    
    braceExpansion?: boolean

    Enables Bash-like brace expansion.

    true
    
    caseSensitiveMatch?: boolean

    Enables a case-sensitive mode for matching files.

    true
    
    concurrency?: number

    Specifies the maximum number of concurrent requests from a reader to read directories.

    os.cpus().length
    
    cwd?: string | URL

    The current working directory in which to search.

    process.cwd()
    
    deep?: number

    Specifies the maximum depth of a read directory relative to the start directory.

    Infinity
    
    dot?: boolean

    Allow patterns to match entries that begin with a period (.).

    false
    
    expandDirectories?: ExpandDirectoriesOption

    If set to true, globby will automatically glob directories for you. If you define an Array it will only glob files that matches the patterns inside the Array. You can also define an Object with files and extensions like in the example below.

    Note that if you set this option to false, you won't get back matched directories unless you set onlyFiles: false.

    true
    
    import {globby} from 'globby';

    const paths = await globby('images', {
    expandDirectories: {
    files: ['cat', 'unicorn', '*.jpg'],
    extensions: ['png']
    }
    });

    console.log(paths);
    //=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
    expandNegationOnlyPatterns?: boolean

    When only negation patterns are provided (e.g., ['!*.json']), automatically prepend a catch-all pattern (**/*) to match all files before applying negations.

    Set to false to return an empty array when only negation patterns are provided. This can be useful when patterns are user-controlled, to avoid unexpectedly matching all files.

    true
    
    import {globby} from 'globby';

    // Default behavior: matches all files except .json
    await globby(['!*.json']);
    //=> ['file.txt', 'image.png', ...]

    // Disable expansion: returns empty array
    await globby(['!*.json'], {expandNegationOnlyPatterns: false});
    //=> []
    extglob?: boolean

    Enables Bash-like extglob functionality.

    true
    
    followSymbolicLinks?: boolean

    Indicates whether to traverse descendants of symbolic link directories.

    true
    
    fs?: Partial<FileSystemAdapter>

    Custom implementation of methods for working with the file system.

    fs.*
    
    gitignore?: boolean

    Respect ignore patterns in .gitignore files that apply to the globbed files.

    When enabled, globby searches for .gitignore files from the current working directory downward, and if a Git repository is detected (by finding a .git directory), it also respects .gitignore files in parent directories up to the repository root. This matches Git's actual behavior where patterns from parent .gitignore files apply to subdirectories.

    Gitignore patterns take priority over user patterns, matching Git's behavior. To include gitignored files, set this to false.

    The ignore option applies to the results only. A pattern that could name an ignore file, such as '**/.gitignore', is not used when searching for the ignore files, so it hides them from the results without disabling this option.

    Performance: Globby reads .gitignore files before globbing and hands fast-glob patterns for the directories it can prove are ignored, so whole ignored directories (like large node_modules or build outputs) are skipped during traversal instead of being enumerated and filtered afterwards. This holds even when negation patterns (like !important.log) or parent .gitignore files are present: only the rules that provably cannot be re-included by a negation are used to skip directories, while the final filtering always matches Git's behavior. To read fewer ignore files, use ignoreFiles: '.gitignore' to target only the root ignore file.

    false
    
    globstar?: boolean

    Enables recursively repeats a pattern containing **. If false, ** behaves exactly like *.

    true
    
    ignore?: string[]

    An array of glob patterns to exclude matches. This is an alternative way to use negative patterns.

    []
    
    ignoreFiles?: string | readonly string[]

    Glob patterns to look for ignore files, which are then used to ignore globbed files.

    This is a more generic form of the gitignore option, allowing you to find ignore files with a compatible syntax. For instance, this works with Babel's .babelignore, Prettier's .prettierignore, or ESLint's .eslintignore files.

    The ignore option applies to the results only, as with the gitignore option.

    Performance tip: Using a specific path like '.gitignore' is much faster than recursive patterns.

    undefined
    
    markDirectories?: boolean

    Mark the directory path with the final slash.

    false
    
    matcher?: MatcherFunction
    objectMode?: boolean

    Returns objects (instead of strings) describing entries.

    false
    
    onlyDirectories?: boolean

    Return only directories.

    false
    
    onlyFiles?: boolean

    Return only files.

    true
    
    stats?: boolean

    Enables an object mode (objectMode) with an additional stats field.

    false
    
    suppressErrors?: boolean

    By default this package suppress only ENOENT errors. Set to true to suppress any error.

    false
    
    throwErrorOnBrokenSymbolicLink?: boolean

    Throw an error when symbolic link is broken if true or safely return lstat call if false.

    false
    
    unique?: boolean

    Ensures that the returned entries are unique.

    true