export const ensureDirectory = async ({ at }) => {
Ensures that a directory exists.
Target style API. Preferred for new code.
File System
Source: fs/file.mjs
Target Style
export const ensureDirectory = async ({ at }) => {
Ensures that a directory exists.
Target style API. Preferred for new code.
export const ensureParentDirectory = async ({ for: filePath }) => {
Ensures that the parent directory for a file path exists.
Target style API. Preferred for new code.
export const listFiles = async ({ in: dirPath }) => {
Lists absolute file paths inside a directory.
Target style API. Preferred for new code.
export const fileExistsAt = async (filePath) => {
Checks whether a file exists at a path.
Target style API. Preferred for new code.
export const writeFile = async (contents, { to, encoding = 'utf-8', createDirectories = false } = {}) => {
Writes file contents to a path.
Target style API. Preferred for new code.
export const readFile = async ({ from, encoding = 'utf-8' } = {}) => {
Reads text contents from a file.
Target style API. Preferred for new code.
export const copyFile = async ({ from, to, onProgress, createDirectories = false } = {}) => {
Copies a file between paths.
Target style API. Preferred for new code.
export const moveFile = async ({ from, to, onProgress, createDirectories = false } = {}) => {
Moves a file into a destination path.
Target style API. Preferred for new code.
export const removeFile = async ({ at, throwIfNotExist = false } = {}) => {
Removes a file by path.
Target style API. Preferred for new code.
export const removeDirectory = async ({ at }) => {
Removes a directory recursively.
Target style API. Preferred for new code.
export const fileSize = async ({ at }) => {
Reads the size of a file in bytes.
Target style API. Preferred for new code.
Legacy Style
export const makeDirectory = async (fullPath) => {
No description provided.
Legacy API. Kept for older code and not the preferred choice for new code.
export const readDirectory = async (dirPath) => {
No description provided.
Legacy API. Kept for older code and not the preferred choice for new code.
export const fileExists = async ({ at }) => fileExistsAt(at)
Checks whether a file exists.
Legacy API. Kept for older code and not the preferred choice for new code.