import { globSync } from 'node:fs';
console.log(globSync('*.js'));
Search the reference...
/
function
paths of files that match the pattern.
import { globSync } from 'node:fs';
console.log(globSync('*.js'));
paths of files that match the pattern.
import { globSync } from 'node:fs';
console.log(globSync('*.js'));
paths of files that match the pattern.
import { globSync } from 'node:fs';
console.log(globSync('*.js'));
paths of files that match the pattern.
Current working directory.
Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return true to exclude the item, false to include it. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported.
true if the glob should return paths as Dirents, false otherwise.
A representation of a directory entry, which can be a file or a subdirectory within the directory, as returned by reading from an fs.Dir. The directory entry is a combination of the file name and file type pairs.
Additionally, when readdir or readdirSync is called with the withFileTypes option set to true, the resulting array is filled with fs.Dirent objects, rather than strings or Buffer s.
The file name that this fs.Dirent object refers to. The type of this value is determined by the options.encoding passed to readdir or readdirSync.
The path to the parent directory of the file this fs.Dirent object refers to.
Returns true if the fs.Dirent object describes a block device.
Returns true if the fs.Dirent object describes a character device.
Returns true if the fs.Dirent object describes a file system directory.
Returns true if the fs.Dirent object describes a first-in-first-out (FIFO) pipe.
Returns true if the fs.Dirent object describes a regular file.
Returns true if the fs.Dirent object describes a socket.
Returns true if the fs.Dirent object describes a symbolic link.
Current working directory.
Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return true to exclude the item, false to include it. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported.
true if the glob should return paths as Dirents, false otherwise.
Current working directory.
Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return true to exclude the item, false to include it. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported.
true if the glob should return paths as Dirents, false otherwise.
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →Node fs.globSync function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- API documentation for function node:fs.globSync | Bun