To recursively delete a directory and all its contents, useDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
rm from node:fs/promises. This is like running rm -rf in JavaScript.
These options configure the deletion behavior:
recursive: true- Delete subdirectories and their contentsforce: true- Don’t throw errors if the directory doesn’t exist
force to ensure the directory exists:
See Docs > API > FileSystem for more filesystem operations.