@purescript/node-fs-aff

4.0.0 • Public • Published

purescript-node-fs-aff

Latest release Build Status

Node.FS Wrappers for purescript-aff

The Aff monad lets you write async code with ease, and node-fs-aff lets you easily access the filesystem within Aff.

Example

Consider asynchronously listing only non-hidden directories:

main = launchAff do
  files <- FS.readdir "."
  files' <- flip filterM files \file -> do
    stat <- FS.stat file
    pure $
         FS.isDirectory stat
      && (maybe false (fromChar >>> (/= ".")) $ charAt 0 file)
  liftEff $ print files'

That was easy. Run npm run example to see it work.

Documentation

Module documentation is published on Pursuit.

Readme

Keywords

Package Sidebar

Install

npm i @purescript/node-fs-aff

Weekly Downloads

2

Version

4.0.0

License

MIT

Last publish

Collaborators

  • bkonkle