local-glob
v1.0.2
Published
A high-performance glob library that automatically switches between `Bun.Glob` (in Bun) and `tinyglobby` (in Node.js) for optimal speed.
Readme
LocalGlob
A high-performance glob library that automatically switches between Bun.Glob (in Bun) and tinyglobby (in Node.js) for optimal speed.
Features
- 🚀 Fast: Uses native
Bun.Globin Bun environments, falling back to the highly optimizedtinyglobbyin Node.js. - 📦 Simple API: Provides standard
globandglobSyncmethods. - 🔄 Cross-Runtime: Write once, run anywhere with the best performance for each runtime.
Installation
npm install local-glob
# or
bun add local-globUsage
Asynchronous
import { glob } from "local-glob"
const files = await glob("**/*.ts", { cwd: "./src" })
console.log(files)Synchronous
import { globSync } from "local-glob"
const files = globSync("**/*.ts", { cwd: "./src" })
console.log(files)Options
Supported options include:
cwd: Current working directory.absolute: Return absolute paths.dot: Include dotfiles.onlyFiles: Return only files (default:true).followSymlinks: Follow symbolic links.
License
ISC
