Module

Pipes.Node.FS

Package
purescript-node-stream-pipes
Repository
cakekindel/purescript-node-stream-pipes

#write' Source

write' :: forall r trash m. Union r trash WriteStreamOptions => MonadAff m => MonadThrow Error m => Record r -> FilePath -> Consumer (Maybe Buffer) m Unit

Creates a fs.Writable stream for the file at the given path.

Writing Nothing to this pipe will close the stream.

See Pipes.Node.Stream.withEOS for converting Producer a into Producer (Maybe a), emitting Nothing before exiting.

#create Source

create :: forall m. MonadAff m => MonadThrow Error m => FilePath -> Consumer (Maybe Buffer) m Unit

Open a file in write mode, failing if the file already exists.

write' {flags: "wx"}

#trunc Source

trunc :: forall m. MonadAff m => MonadThrow Error m => FilePath -> Consumer (Maybe Buffer) m Unit

Open a file in write mode, truncating it if the file already exists.

write' {flags: "w"}

#append Source

append :: forall m. MonadAff m => MonadThrow Error m => FilePath -> Consumer (Maybe Buffer) m Unit

Open a file in write mode, appending written contents if the file already exists.

write' {flags: "a"}

#read Source

read :: forall m. MonadAff m => MonadThrow Error m => FilePath -> Producer (Maybe Buffer) m Unit

Creates a fs.Readable stream for the file at the given path.

Emits Nothing before closing. To opt out of this behavior, use Pipes.Node.Stream.withoutEOS or Pipes.Node.Stream.unEOS.

#read' Source

read' :: forall r trash m. Union r trash ReadStreamOptions => MonadAff m => MonadThrow Error m => Record r -> FilePath -> Producer (Maybe Buffer) m Unit

Creates a fs.Readable stream for the file at the given path.

Emits Nothing before closing. To opt out of this behavior, use Pipes.Node.Stream.withoutEOS or Pipes.Node.Stream.unEOS.