@@ -10,6 +10,7 @@ module Node.FS.Async
1010 , readlink
1111 , realpath
1212 , realpath'
13+ , unlink
1314 , readFile
1415 , readTextFile
1516 , writeFile
@@ -51,6 +52,7 @@ foreign import fs "var fs = require('fs');" ::
5152 , symlink :: Fn4 FilePath FilePath String (JSCallback Unit ) Unit
5253 , readlink :: Fn2 FilePath (JSCallback FilePath ) Unit
5354 , realpath :: forall cache . Fn3 FilePath { | cache } (JSCallback FilePath ) Unit
55+ , unlink :: Fn2 FilePath (JSCallback Unit ) Unit
5456 , readFile :: forall a opts . Fn3 FilePath { | opts } (JSCallback a ) Unit
5557 , writeFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
5658 }
@@ -125,7 +127,7 @@ link :: forall eff. FilePath
125127
126128link src dst cb = return $ runFn3
127129 fs.link src dst (handleCallback cb)
128-
130+
129131-- |
130132-- Creates a symlink.
131133--
@@ -157,7 +159,7 @@ realpath :: forall eff. FilePath
157159
158160realpath path cb = return $ runFn3
159161 fs.realpath path {} (handleCallback cb)
160-
162+
161163-- |
162164-- Find the canonicalized absolute location for a path using a cache object for
163165-- already resolved paths.
@@ -170,6 +172,16 @@ realpath' :: forall eff cache. FilePath
170172realpath' path cache cb = return $ runFn3
171173 fs.realpath path cache (handleCallback cb)
172174
175+ -- |
176+ -- Deletes a file.
177+ --
178+ unlink :: forall eff . FilePath
179+ -> Callback eff Unit
180+ -> Eff (fs :: FS | eff ) Unit
181+
182+ unlink file cb = return $ runFn2
183+ fs.unlink file (handleCallback cb)
184+
173185-- |
174186-- Reads the entire contents of a file returning the result as a raw buffer.
175187--
0 commit comments