Module

Node.FS.Async

#Callback

type Callback a = Either Error a -> Effect Unit

Type synonym for callback functions.

#rename

rename :: FilePath -> FilePath -> Callback Unit -> Effect Unit

Renames a file.

#truncate

truncate :: FilePath -> Int -> Callback Unit -> Effect Unit

Truncates a file to the specified length.

#chown

chown :: FilePath -> Int -> Int -> Callback Unit -> Effect Unit

Changes the ownership of a file.

#chmod

chmod :: FilePath -> Perms -> Callback Unit -> Effect Unit

Changes the permissions of a file.

#stat

stat :: FilePath -> Callback Stats -> Effect Unit

Gets file statistics.

#realpath

realpath :: FilePath -> Callback FilePath -> Effect Unit

Find the canonicalized absolute location for a path.

#realpath'

realpath' :: forall cache. FilePath -> Record cache -> Callback FilePath -> Effect Unit

Find the canonicalized absolute location for a path using a cache object for already resolved paths.

#rmdir

rmdir :: FilePath -> Callback Unit -> Effect Unit

Deletes a directory.

#mkdir

mkdir :: FilePath -> Callback Unit -> Effect Unit

Makes a new directory.

#mkdir'

mkdir' :: FilePath -> Perms -> Callback Unit -> Effect Unit

Makes a new directory with the specified permissions.

#readdir

readdir :: FilePath -> Callback (Array FilePath) -> Effect Unit

Reads the contents of a directory.

#utimes

utimes :: FilePath -> DateTime -> DateTime -> Callback Unit -> Effect Unit

Sets the accessed and modified times for the specified file.

#readFile

readFile :: FilePath -> Callback Buffer -> Effect Unit

Reads the entire contents of a file returning the result as a raw buffer.

#readTextFile

readTextFile :: Encoding -> FilePath -> Callback String -> Effect Unit

Reads the entire contents of a text file with the specified encoding.

#writeFile

writeFile :: FilePath -> Buffer -> Callback Unit -> Effect Unit

Writes a buffer to a file.

#writeTextFile

writeTextFile :: Encoding -> FilePath -> String -> Callback Unit -> Effect Unit

Writes text to a file using the specified encoding.

#appendFile

appendFile :: FilePath -> Buffer -> Callback Unit -> Effect Unit

Appends the contents of a buffer to a file.

#appendTextFile

appendTextFile :: Encoding -> FilePath -> String -> Callback Unit -> Effect Unit

Appends text to a file using the specified encoding.

#exists

exists :: FilePath -> (Boolean -> Effect Unit) -> Effect Unit

Check if the path exists.

#fdOpen

fdOpen :: FilePath -> FileFlags -> Maybe FileMode -> Callback FileDescriptor -> Effect Unit

Open a file asynchronously. See the Node Documentation for details.

#fdRead

fdRead :: FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback ByteCount -> Effect Unit

Read from a file asynchronously. See the Node Documentation for details.

#fdNext

fdNext :: FileDescriptor -> Buffer -> Callback ByteCount -> Effect Unit

Convenience function to fill the whole buffer from the current file position.

#fdWrite

fdWrite :: FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback ByteCount -> Effect Unit

Write to a file asynchronously. See the Node Documentation for details.

#fdAppend

fdAppend :: FileDescriptor -> Buffer -> Callback ByteCount -> Effect Unit

Convenience function to append the whole buffer to the current file position.

#fdClose

fdClose :: FileDescriptor -> Callback Unit -> Effect Unit

Close a file asynchronously. See the Node Documentation for details.

Modules