File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 123
123
124
124
chown :: forall eff. FilePath -> Number -> Number -> Eff (err :: Exception, fs :: FS | eff) Unit
125
125
126
+ exists :: forall eff. FilePath -> Eff (fs :: FS | eff) Boolean
127
+
126
128
link :: forall eff. FilePath -> FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit
127
129
128
130
mkdir :: forall eff. FilePath -> Eff (err :: Exception, fs :: FS | eff) Unit
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ module Node.FS.Sync
21
21
, writeTextFile
22
22
, appendFile
23
23
, appendTextFile
24
+ , exists
24
25
) where
25
26
26
27
import Control.Monad.Eff
@@ -52,6 +53,7 @@ foreign import fs "var fs = require('fs');" ::
52
53
, readFileSync :: forall a opts . Fn2 FilePath { | opts } a
53
54
, writeFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
54
55
, appendFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
56
+ , existsSync :: Fn1 FilePath Boolean
55
57
}
56
58
57
59
foreign import mkEff
@@ -278,3 +280,11 @@ appendTextFile :: forall eff. Encoding
278
280
279
281
appendTextFile encoding file buff = mkEff $ \_ -> runFn3
280
282
fs.appendFileSync file buff { encoding: show encoding }
283
+
284
+ -- |
285
+ -- Check if the path exists.
286
+ --
287
+ exists :: forall eff . FilePath
288
+ -> Eff (fs :: FS | eff ) Boolean
289
+ exists file = mkEff $ \_ -> runFn1
290
+ fs.existsSync file
You can’t perform that action at this time.
0 commit comments