@@ -8,6 +8,8 @@ module Node.FS.Async
88 , link
99 , symlink
1010 , readlink
11+ , realpath
12+ , realpath'
1113 , readFile
1214 , readTextFile
1315 , writeFile
@@ -48,6 +50,7 @@ foreign import fs "var fs = require('fs');" ::
4850 , link :: Fn3 FilePath FilePath (JSCallback Unit ) Unit
4951 , symlink :: Fn4 FilePath FilePath String (JSCallback Unit ) Unit
5052 , readlink :: Fn2 FilePath (JSCallback FilePath ) Unit
53+ , realpath :: forall cache . Fn3 FilePath { | cache } (JSCallback FilePath ) Unit
5154 , readFile :: forall a opts . Fn3 FilePath { | opts } (JSCallback a ) Unit
5255 , writeFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
5356 }
@@ -145,6 +148,28 @@ readlink :: forall eff. FilePath
145148readlink path cb = return $ runFn2
146149 fs.readlink path (handleCallback cb)
147150
151+ -- |
152+ -- Find the canonicalized absolute location for a path.
153+ --
154+ realpath :: forall eff . FilePath
155+ -> Callback eff FilePath
156+ -> Eff (fs :: FS | eff ) Unit
157+
158+ realpath path cb = return $ runFn3
159+ fs.realpath path {} (handleCallback cb)
160+
161+ -- |
162+ -- Find the canonicalized absolute location for a path using a cache object for
163+ -- already resolved paths.
164+ --
165+ realpath' :: forall eff cache . FilePath
166+ -> { | cache }
167+ -> Callback eff FilePath
168+ -> Eff (fs :: FS | eff ) Unit
169+
170+ realpath' path cache cb = return $ runFn3
171+ fs.realpath path cache (handleCallback cb)
172+
148173-- |
149174-- Reads the entire contents of a file returning the result as a raw buffer.
150175--
0 commit comments